Spaces:
Runtime error
Runtime error
Download app.py from startupideas/queen_bee_detection: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/spaces/startupideas/queen_bee_detection/resolve/main/app.py
- Command line
-
hf download hf://spaces/startupideas/queen_bee_detection/app.py
-
curl -L -o app.py https://huggingface.co/spaces/startupideas/queen_bee_detection/resolve/main/app.py
559 Bytes
| from fastai.vision.all import * | |
| import gradio as gr | |
| #def is_cat(x): | |
| # return x[0].isupper() | |
| learn = load_learner('model_bee.pkl') | |
| categories = ('queen','worker') | |
| def classify_image(img): | |
| pred,idx,probs = learn.predict(img) | |
| return dict(zip(categories, map(float,probs))) | |
| image = gr.inputs.Image(shape=(192,192)) | |
| label = gr.outputs.Label() | |
| examples = ['queen.jpg','worker.jpg','queen2.jpg','worker1.jpg','worker2.jpg','queen1.jpg'] | |
| iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples = examples) | |
| iface.launch() |