Spaces:
Runtime error
Runtime error
| import cv2 | |
| from tensorflow.keras.models import load_model | |
| from PIL import Image | |
| import numpy as np | |
| import tensorflow as tf | |
| import streamlit as st | |
| import tempfile | |
| model = load_model('HandSignClassifierGUD.h5') | |
| # Open the video file | |
| f = st.file_uploader("Choose a Video") | |
| 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'] | |
| # Read the video file from the file-like object | |
| if f is not None: | |
| img = Image.open(f) | |
| img = img.resize((28,28)) | |
| img = img.convert('L') | |
| img = np.reshape(img,(1,28,28,1)) | |
| pred = model.predict(img) | |
| st.image(img,use_column_width=True) | |
| st.write(array[np.argmax(pred)]) | |