Spaces:
Sleeping
Sleeping
from fastai.vision.all import * | |
import gradio as gr | |
learn = load_learner('dog-breed-model.pkl') | |
def classify_img(image): | |
pred,idx,probs = learn.predict(image) | |
return pred.split('-')[1] | |
image = gr.inputs.Image(shape=(192,192)) | |
label = gr.outputs.Label() | |
examples = ['dog.jpg', 'kelpie.jpg'] | |
intf = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples) | |
intf.launch(inline=False) | |