Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,15 +5,16 @@ import numpy as np
|
|
| 5 |
import tensorflow as tf
|
| 6 |
import streamlit as st
|
| 7 |
import tempfile
|
| 8 |
-
model = load_model('HandSignClassifier
|
| 9 |
# Open the video file
|
| 10 |
f = st.file_uploader("Choose a Video")
|
| 11 |
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']
|
| 12 |
# Read the video file from the file-like object
|
| 13 |
if f is not None:
|
| 14 |
img = Image.open(f)
|
| 15 |
-
img = img.resize((
|
| 16 |
-
img =
|
|
|
|
| 17 |
pred = model.predict(img)
|
| 18 |
st.image(img,use_column_width=True)
|
| 19 |
st.write(array[np.argmax(pred)])
|
|
|
|
| 5 |
import tensorflow as tf
|
| 6 |
import streamlit as st
|
| 7 |
import tempfile
|
| 8 |
+
model = load_model('HandSignClassifier.h5')
|
| 9 |
# Open the video file
|
| 10 |
f = st.file_uploader("Choose a Video")
|
| 11 |
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']
|
| 12 |
# Read the video file from the file-like object
|
| 13 |
if f is not None:
|
| 14 |
img = Image.open(f)
|
| 15 |
+
img = img.resize((28,28))
|
| 16 |
+
img = img.convert('L')
|
| 17 |
+
img = np.reshape(img,(1,28,28,1))
|
| 18 |
pred = model.predict(img)
|
| 19 |
st.image(img,use_column_width=True)
|
| 20 |
st.write(array[np.argmax(pred)])
|