Spaces:
Sleeping
Sleeping
Download app.py from ursulacst/Challenge4: direct link, hf CLI and curl.
- Browser
- Download file 536 Bytes
-
https://huggingface.co/spaces/ursulacst/Challenge4/resolve/main/app.py
- Command line
-
hf download hf://spaces/ursulacst/Challenge4/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ursulacst/Challenge4/resolve/main/app.py
536 Bytes
| from fastai.vision.all import * | |
| import gradio as gr | |
| import skimage | |
| learn = load_learner('model.pkl') | |
| categories = ('Normal', 'Cancer') | |
| def classify_image(img): | |
| pred,idx,probs = learn.predict(img) | |
| return dict(zip(categories, map(float,probs))) | |
| image = gr.inputs.Image() | |
| label = gr.outputs.Label() | |
| examples = ['Cancer.png', 'Normal.png', 'NormalDif.png'] | |
| interpretation='default' | |
| intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, interpretation=interpretation) | |
| intf.launch(inline=False) | |