Spaces:
Runtime error
Runtime error
from fastai.vision.all import * | |
import gradio as gr | |
learn = load_learner('model.pth') | |
def classify_image(img): | |
name, prob = celebrity_name,_,probs = learn.predict(img) | |
return {name: prob} | |
image = gr.inputs.Image(shape=(224,224)) | |
label = gr.outputs.Label() | |
examples = ['emma_watson.jpeg', "tom_hanks.jpeg"] | |
iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples) | |
iface.launch(inline=False) |