Spaces:
Runtime error
Runtime error
Download app.py from GameHasNoGame/BearClassifier: direct link, hf CLI and curl.
- Browser
- Download file 497 Bytes
-
https://huggingface.co/spaces/GameHasNoGame/BearClassifier/resolve/main/app.py
- Command line
-
hf download hf://spaces/GameHasNoGame/BearClassifier/app.py
-
curl -L -o app.py https://huggingface.co/spaces/GameHasNoGame/BearClassifier/resolve/main/app.py
497 Bytes
| import gradio as gr | |
| from fastai.vision.all import * | |
| learn = load_learner('export.pkl') | |
| def predict_image(img): | |
| prediction, _, _ = learn.predict(img) | |
| return prediction | |
| # UI huggface | |
| # image = gr.Image(shape=(192, 192)) | |
| # label = gr.Label() | |
| #intrfce = gr.Interface(fn=predict_image, inputs=image, outputs=label) | |
| intrfce = gr.Interface(fn=predict_image, | |
| inputs=gr.Image(type="pil"), | |
| outputs=gr.Label(num_top_classes=3)).launch() | |
| # intrfce.launch(inline=False) |