Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,8 +44,10 @@ if f is not None:
|
|
| 44 |
if frame_count % interval == 0:
|
| 45 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Convert to grayscale
|
| 46 |
frame = cv2.resize(frame, (28, 28)) # Resize to (28, 28)
|
| 47 |
-
frame = np.reshape(frame, (1, 28, 28, 1))
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
pred = np.argmax(pred)
|
| 50 |
pred = array[pred]
|
| 51 |
if not out or out[-1] != pred:
|
|
|
|
| 44 |
if frame_count % interval == 0:
|
| 45 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Convert to grayscale
|
| 46 |
frame = cv2.resize(frame, (28, 28)) # Resize to (28, 28)
|
| 47 |
+
frame = np.reshape(frame, (1, 28, 28, 1))
|
| 48 |
+
st.image(frame, 'input')# Reshape
|
| 49 |
+
pred = model.predict(frame)
|
| 50 |
+
st.write(pred)
|
| 51 |
pred = np.argmax(pred)
|
| 52 |
pred = array[pred]
|
| 53 |
if not out or out[-1] != pred:
|