Spaces:
Runtime error
Runtime error
Download app.py from suhailidrees/instruments: direct link, hf CLI and curl.
- Browser
- Download file 364 Bytes
-
https://huggingface.co/spaces/suhailidrees/instruments/resolve/main/app.py
- Command line
-
hf download hf://spaces/suhailidrees/instruments/app.py
-
curl -L -o app.py https://huggingface.co/spaces/suhailidrees/instruments/resolve/main/app.py
364 Bytes
| from fastai.vision.all import * | |
| import gradio as gr | |
| learn = load_learner("model.pkl") | |
| categories = ('Guitar','Piano') | |
| def classify_image(image): | |
| outcome,idx,probs = learn.predict(image) | |
| return dict(zip(categories,map(float,probs))) | |
| iface = gr.Interface( | |
| fn = classify_image, | |
| inputs = "image", | |
| outputs = gr.outputs.Label() | |
| ) | |
| iface.launch() |