File size: 445 Bytes
c0b535e
be5d1c1
 
c0b535e
 
 
be5d1c1
c0b535e
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastai.vision.all import *
import gradio as gr

def classify_image(img):
    pred, idx, probs = learn.predict(img)
    return pred

learn = load_learner("mode.pkl")

image = gr.inputs.Image(shape=(192,192))
label = gr.outputs.Label()
examples = ['flag_australia.jpg', 'flag_chad.jpg', 'flag_ecuador.jpg', 'flag_monaco.jpg']

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