Gosula commited on
Commit
6ef77e0
1 Parent(s): 4679224

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -144,14 +144,15 @@ canvas_result = st_canvas(
144
  key="full_app",
145
  )
146
 
 
147
  # Do something interesting with the image data and paths
148
  if canvas_result.image_data is not None:
 
149
  image = canvas_result.image_data
150
  image1 = image.copy()
151
- image1 = cv2.cvtColor(image1, cv2.COLOR_BGR2GRAY).astype('float32') # Convert to float32
152
- image1 = cv2.resize(image1, (28, 28))
153
- image1 /= 255.0 # Normalize the values to [0, 1]
154
- # Convert to uint8 format (bytes)
155
  st.image(image1)
156
 
157
 
 
144
  key="full_app",
145
  )
146
 
147
+ # Do something interesting with the image data and paths
148
  # Do something interesting with the image data and paths
149
  if canvas_result.image_data is not None:
150
+ #st.image(canvas_result.image_data)
151
  image = canvas_result.image_data
152
  image1 = image.copy()
153
+ image1 = image1.astype('uint8')
154
+ image1 = cv2.cvtColor(image1,cv2.COLOR_BGR2GRAY)
155
+ image1 = cv2.resize(image1,(28,28))
 
156
  st.image(image1)
157
 
158