neatclf / app.py
sl207's picture
Update app.py
dcc7f81 verified
raw
history blame
350 Bytes
import gradio as gr
from fastai.learner import load_learner
learn = load_learner('model.pkl')
labels = ['Adidas Shoe', 'New Balance Shoe', 'Nike Show']
def predict(image):
brand, idx, probs = learn.predict(image)
return dict(zip(labels, map(float,probs)))
demo = gr.Interface(fn=predict, inputs=gr.Image(), outputs=gr.Label())
demo.launch()