Spaces:
Runtime error
Runtime error
File size: 432 Bytes
e345bbb abdee9b e345bbb abdee9b e345bbb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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) |