Bytte commited on
Commit
97797c8
·
1 Parent(s): 49a7732

model added

Browse files
Files changed (2) hide show
  1. app.py +31 -2
  2. dermatologist_fastai.pkl +3 -0
app.py CHANGED
@@ -1,7 +1,36 @@
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
- demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
1
  import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+ learner = load_learner('dermatologist_fastai.pkl')
5
+ categories = (
6
+ 'acne_vulgaris',
7
+ 'actinic_keratosis',
8
+ 'allergic_contact_dermatitis',
9
+ 'dermatofibroma',
10
+ 'drug_induced_pigmentary_changes',
11
+ 'granuloma_annulare',
12
+ 'hidradenitis',
13
+ 'kaposi_sarcoma',
14
+ 'melanoma',
15
+ 'necrobiosis_lipoidica',
16
+ 'nematode_infection',
17
+ 'neutrophilic_dermatoses',
18
+ 'photodermatoses',
19
+ 'psoriasis',
20
+ 'sarcoidosis',
21
+ 'xeroderma_pigmentosum'
22
+ )
23
+
24
+ def predict(img):
25
+ preds, idx, probs = learner.predict(img)
26
+ return dict(zip(categories, map(float, probs)))
27
 
28
  def greet(name):
29
  return "Hello " + name + "!!"
30
 
31
+ image = gr.inputs.Image()
32
+ label = gr.outputs.Label()
33
+
34
+
35
+ demo = gr.Interface(fn=predict, inputs=image, outputs=label)
36
+ demo.launch(inline=False)
dermatologist_fastai.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5751c152926d3d696a1943c1ceef49ea71c5011775dc04207cbb2c7b2a924d3
3
+ size 47097515