Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from fastai.vision.all import * | |
| learn = load_learner("model.pkl") | |
| categories = ["Bald Eagle", "Osprey"] | |
| def classify(img): | |
| pred,idx,probs = learn.predict(img) | |
| return dict(zip(categories, map(float,probs))) | |
| iface = gr.Interface(fn=classify, inputs="image", outputs="label") | |
| iface.launch() | |