File size: 554 Bytes
8395544
 
b85b1fa
 
8395544
 
 
 
 
b85b1fa
 
8395544
 
 
b85b1fa
 
550ae00
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
from transformers import pipeline
from PIL import Image
import io

# Load your sign language detection model
model = pipeline("image-classification", model="RavenOnur/Sign-Language")

def classify_image(image):
    # Ensure the image is in RGB format
    image = image.convert("RGB")
    results = model(image)
    return {result['label']: result['score'] for result in results}

# Define the Gradio interface
interface = gr.Interface(fn=classify_image, inputs=gr.Image(type="pil"), outputs="label")
interface.launch(show_error=True)