Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from fastai.vision.all import * | |
| leaner = load_learner('model.pkl') | |
| categories = ['black', 'grizzly', 'teddy'] | |
| def predict(img): | |
| preds,idx,probs = leaner.predict(img) | |
| return dict(zip(categories,map(float,probs))) | |
| demo = gr.Interface(fn=predict, | |
| inputs=gr.inputs.Image(shape=(224, 224)), | |
| outputs= gr.outputs.Label() | |
| ) | |
| demo.launch(inline=False) |