storesource commited on
Commit
49d4d61
1 Parent(s): ac57e68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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#["image_data"]
61
- # preprocessed_image = preprocess_image(image_from_canvas)
62
- # predicted_label = predict(preprocessed_image)
63
- st.text(f"Predicted label: {image_from_canvas}")
 
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