Spaces:
Sleeping
Sleeping
Download app.py from Pathovis/Skin_Cancer_Detection: direct link, hf CLI and curl.
- Browser
- Download file 546 Bytes
-
https://huggingface.co/spaces/Pathovis/Skin_Cancer_Detection/resolve/main/app.py
- Command line
-
hf download hf://spaces/Pathovis/Skin_Cancer_Detection/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Pathovis/Skin_Cancer_Detection/resolve/main/app.py
546 Bytes
| from fastai.vision.all import * | |
| import gradio as gr | |
| learn = load_learner('export.pkl') | |
| categories = ('Benign', 'Malignant') | |
| def classify_image(img): | |
| pred,idx,probs = learn.predict(img) | |
| return dict(zip(categories, map(float,probs))) | |
| image = gr.Image(width=192, height=192) | |
| label = gr.Label() | |
| examples = ['Benign 1.jpg','Benign 2.jpg','Benign 3.jpg', 'Malignant 1.jpg', | |
| 'Malignant 2.jpg', 'Malignant 3.jpg'] | |
| intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples) | |
| intf.launch(inline=False) | |