Download app.py from ziaS/DermNet: direct link, hf CLI and curl.
- Browser
- Download file 594 Bytes
-
https://huggingface.co/spaces/ziaS/DermNet/resolve/main/app.py
- Command line
-
hf download hf://spaces/ziaS/DermNet/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ziaS/DermNet/resolve/main/app.py
594 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() | |
| label = gr.Label() | |
| examples = ['benign.jpg','malignant.jpg'] | |
| title = 'Skin Cancer Predictor' | |
| description = 'This app predicts skin cancer. For reference only.' | |
| intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, title=title, description=description) | |
| intf.launch(inline=False) | |