Spaces:
Runtime error
Runtime error
evawade17
commited on
Commit
·
4a66412
1
Parent(s):
6f3642b
something
Browse files- app.py +20 -0
- export.pkl +3 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
learn = load_learner("export.pkl")
|
5 |
+
|
6 |
+
categories = ("Benign", "Malignant")
|
7 |
+
|
8 |
+
def classify_image(img):
|
9 |
+
pred,idx,probs = learn.predict(img)
|
10 |
+
return dict(zip(categories, map(float,probs)))
|
11 |
+
|
12 |
+
image = gr.inputs.Image(shape=(192,192))
|
13 |
+
label = gr.outputs.Label()
|
14 |
+
examples = ['benign.jpg','malignant.jpg']
|
15 |
+
title = 'Skin Cancer Predictor'
|
16 |
+
description = 'This app predicts skin cancer. For reference only.'
|
17 |
+
article = "Author: <a href=\"https://huggingface.co/evawade17\">Eva Wade</a>. "
|
18 |
+
|
19 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, title=title, description=description, article=article)
|
20 |
+
intf.launch(inline=False)
|
export.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:76d338dee621cbe89c0045b757a4dc0d8cf039bba93937ec933af61f3959aed3
|
3 |
+
size 87509473
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastai
|
2 |
+
timm
|