Spaces:
Sleeping
Sleeping
storesource
commited on
Commit
•
49d4d61
1
Parent(s):
ac57e68
Update app.py
Browse files
app.py
CHANGED
@@ -57,10 +57,11 @@ canvas_result = st_canvas(
|
|
57 |
# Add a submit button
|
58 |
if st.button("Submit"):
|
59 |
if canvas_result.json_data:
|
60 |
-
image_from_canvas = canvas_result
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
64 |
else:
|
65 |
st.text("Please draw an image on the canvas before submitting.")
|
66 |
|
|
|
57 |
# Add a submit button
|
58 |
if st.button("Submit"):
|
59 |
if canvas_result.json_data:
|
60 |
+
image_from_canvas = canvas_result.image_data
|
61 |
+
st.text(f"Original data: {image_from_canvas}")
|
62 |
+
preprocessed_image = preprocess_image(image_from_canvas)
|
63 |
+
predicted_label = predict(preprocessed_image)
|
64 |
+
st.text(f"Predicted label: {predicted_label}")
|
65 |
else:
|
66 |
st.text("Please draw an image on the canvas before submitting.")
|
67 |
|