archietramjnj commited on
Commit
f20d83d
1 Parent(s): b1b58e2

upload app

Browse files
Files changed (10) hide show
  1. Benign1.jpg +0 -0
  2. Benign2.jpg +0 -0
  3. Benign3.jpg +0 -0
  4. Malignant1.jpg +0 -0
  5. Malignant2.jpg +0 -0
  6. Malignant3.jpg +0 -0
  7. app.ipynb +0 -0
  8. app.py +20 -0
  9. export.pkl +3 -0
  10. requirements.txt +2 -0
Benign1.jpg ADDED
Benign2.jpg ADDED
Benign3.jpg ADDED
Malignant1.jpg ADDED
Malignant2.jpg ADDED
Malignant3.jpg ADDED
app.ipynb ADDED
File without changes
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 = ['Benign1.jpg','Benign2.jpg','Benign3.jpg', 'Malignant1.jpg', 'Malignant2.jpg', 'Malignant3.jpg']
15
+ title = 'Skin Cancer Predictor'
16
+ description = 'This app predicts whether skin cancer is benign or malignant. For reference only.'
17
+ article = "Author: <a href=\"https://huggingface.co/archietram\">Archie Tram</a>. "
18
+
19
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
20
+ intf.launch(inline=False)
export.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13bfd8d2000c9d5b2fe6240bc9f62624ec82b14388f5b526c7a586b67ebb14b4
3
+ size 64621065
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastai
2
+ timm