sega / app.py
JefferyJapheth's picture
Upload app.py
808add1
import gradio as gr
import tensorflow as tf
import numpy as np
# Load your sign language prediction model
model = tf.keras.models.load_model(r"C:\Users\Jeffery.st\Desktop\st.Jeffery00\mega\model.h5")
# Define the prediction function
def predict_sign_language(image):
# Run inference using the model
prediction = model.predict(np.expand_dims(image, axis=0))
# ... (post-processing if required)
return prediction
# Define the webcam input component
webcam_input = gr.inputs.Image(source="webcam")
# Define the output component
label_output = gr.outputs.Label()
# Create the Gradio interface
iface = gr.Interface(fn=predict_sign_language, inputs=webcam_input, outputs=label_output)
# Launch the interface
iface.launch()