Spaces:
Runtime error
Runtime error
import gradio as gr | |
from fastai.vision.all import * | |
import skimage | |
learn = load_learner("asl-baseline.pkl") | |
labels = learn.dls.vocab | |
def classify_asl(img): | |
img = PILImage.create(img) | |
pred,idx,probs = learn.predict(img) | |
return {labels[i]: float(probs[i]) for i in range(len(labels))} | |
image = gr.inputs.Image(shape = (128,128)) | |
label = gr.outputs.Label(num_top_classes=29) | |
title = "ASL Classifier" | |
interpretation='default' | |
enable_queue=True | |
iface = gr.Interface(fn=classify_asl, inputs=image, outputs=label,title=title,interpretation=interpretation,enable_queue=enable_queue) | |
iface.launch(inline=False) |