Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ canvas_result = st_canvas(
|
|
| 32 |
|
| 33 |
if canvas_result.image_data is not None:
|
| 34 |
st.image(canvas_result.image_data, caption="Original Drawing")
|
| 35 |
-
img = cv2.cvtColor(canvas_result.image_data.astype("uint8"), cv2.
|
| 36 |
img = 255 - img
|
| 37 |
img_resized = cv2.resize(img, (28, 28))
|
| 38 |
img_normalized = img_resized / 255.0
|
|
|
|
| 32 |
|
| 33 |
if canvas_result.image_data is not None:
|
| 34 |
st.image(canvas_result.image_data, caption="Original Drawing")
|
| 35 |
+
img = cv2.cvtColor(canvas_result.image_data.astype("uint8"), cv2.COLOR_RGBA2GRAY)
|
| 36 |
img = 255 - img
|
| 37 |
img_resized = cv2.resize(img, (28, 28))
|
| 38 |
img_normalized = img_resized / 255.0
|