Dog-breeds / app.py
stephen
Changes to be committed:
c211e77
raw
history blame
447 Bytes
from fastai.vision.all import *
import gradio as gr
learn = load_learner('dog-breed-model.pkl')
learn.predict(im)
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)