neatclf / app.py
sl207's picture
Update app.py
ba7f700 verified
raw
history blame
392 Bytes
import gradio as gr
from fastai.vision.all import *
import skimage
learn = load_learner('model.pkl')
labels = ['Adidas Shoe', 'New Balance Shoe', 'Nike Show']
def predict(image):
image = PILImage.create(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()