Spaces:
Build error
Build error
Download app.py from michael20at/MNIST_test: direct link, hf CLI and curl.
- Browser
- Download file 529 Bytes
-
https://huggingface.co/spaces/michael20at/MNIST_test/resolve/main/app.py
- Command line
-
hf download hf://spaces/michael20at/MNIST_test/app.py
-
curl -L -o app.py https://huggingface.co/spaces/michael20at/MNIST_test/resolve/main/app.py
529 Bytes
| __all__ = ['learn', 'classicy_image', 'categories', 'image', 'label', 'examples', 'intf'] | |
| from fastai.vision.all import * | |
| import gradio as gr | |
| learn = load_learner('mnist_model.pkl') | |
| def classify_image(img): | |
| pred,idx,probs = learn.predict(img) | |
| return pred | |
| image = gr.Image(width=192, height=192) | |
| label = gr.Label() | |
| examples = ["5.png"] | |
| #intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples) | |
| intf = gr.Interface(fn=classify_image, inputs=image, outputs=label) | |
| intf.launch(inline=False) |