Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ if f is not None:
|
|
| 28 |
# Initialize a counter for frames
|
| 29 |
frame_count = 0
|
| 30 |
model = tf.keras.models.load_model('HandSignClassifier (1).h5')
|
| 31 |
-
array = ['a','b','c','d','e','f','g','h','i','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y']
|
| 32 |
out = ''
|
| 33 |
|
| 34 |
while True:
|
|
@@ -42,9 +42,8 @@ if f is not None:
|
|
| 42 |
|
| 43 |
# Check if it's time to capture a frame
|
| 44 |
if frame_count % interval == 0:
|
| 45 |
-
frame = cv2.
|
| 46 |
-
frame =
|
| 47 |
-
frame = np.reshape(frame, (1, 28, 28, 1))
|
| 48 |
st.image(frame, 'input')# Reshape
|
| 49 |
pred = model.predict(frame)
|
| 50 |
st.write(pred)
|
|
|
|
| 28 |
# Initialize a counter for frames
|
| 29 |
frame_count = 0
|
| 30 |
model = tf.keras.models.load_model('HandSignClassifier (1).h5')
|
| 31 |
+
array = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','del','nothing','space']
|
| 32 |
out = ''
|
| 33 |
|
| 34 |
while True:
|
|
|
|
| 42 |
|
| 43 |
# Check if it's time to capture a frame
|
| 44 |
if frame_count % interval == 0:
|
| 45 |
+
frame = cv2.resize(frame, (256, 256)) # Resize to (28, 28)
|
| 46 |
+
frame = np.reshape(frame, (1, 256, 256, 3))
|
|
|
|
| 47 |
st.image(frame, 'input')# Reshape
|
| 48 |
pred = model.predict(frame)
|
| 49 |
st.write(pred)
|