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()