File size: 420 Bytes
e345bbb
abdee9b
 
f9458a9
abdee9b
e345bbb
224c31d
39f6d6c
e345bbb
 
 
1ad3ceb
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.pkl')

def classify_image(img):
    celebrity_name,_,probs = learn.predict(img)
    return celebrity_name

image = gr.inputs.Image(shape=(224,224))
label = gr.outputs.Label()
examples = ['emma_watson.jpg', "tom_hanks.jpeg"]

iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
iface.launch(inline=False)