vinayakchuniDocplanner commited on
Commit
ad8be4c
1 Parent(s): 795a8b3

Initialized git lfs and added th model,changed app.py

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. app.py +22 -4
  3. modelSkinDiseaseDetector.pkl +3 -0
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ modelSkinDiseaseDetector.pkl filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -1,7 +1,25 @@
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
1
+ # import gradio as gr
2
+
3
+ # def greet(name):
4
+ # return "Hello " + name + "!!"
5
+
6
+ # iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
+ # iface.launch()
8
+
9
+
10
+ from fastai.vision.all import *
11
  import gradio as gr
12
+ diseaseDict={'1':'Eczema','2':'Melanoma','3':'Atopic Dermatitis','4':'Basal Cell Carcinoma','5':'Melanocytic Nevi','6':'Benign Keratosis like Lesions','7':'Psoriasis pictures Lichen Planus and other related diseases','8':'Seborrheic Keratoses and other Benign Tumors','9':'Tinea Ringworm Candidiasis and other Fungal Infections','10':'Warts Molluscum and other Viral Infections'}
13
+ def label_func(x): return diseaseDict[x.parent.name[0]]
14
 
15
+ learn=load_learner('modelSkinDiseaseDetector.pkl')
16
+ categories = ('Eczema','Melanoma','Atopic Dermatitis','Basal Cell Carcinoma','Melanocytic Nevi','Benign Keratosis like Lesions','Psoriasis pictures Lichen Planus and other related diseases','Seborrheic Keratoses and other Benign Tumors','Tinea Ringworm Candidiasis and other Fungal Infections','Warts Molluscum and other Viral Infections')
17
+ def classify_img(img):
18
+ pred,idx,probs=learn.predict(img)
19
+ return dict(zip(categories,map(float,probs)))
20
 
21
+ image=gr.inputs.Image(shape=(192,192))
22
+ label=gr.outputs.Label()
23
+ examples=['disease2.jpg','disease3.jpg','disease3.jpg']
24
+ intf=gr.Interface(fn=classify_img,inputs=image,outputs=label,examples=examples)
25
+ intf.launch(inline=False)
modelSkinDiseaseDetector.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8cf107c1e86a283adc15c0727bf38a398206bbce45fccac3b9050f395f5b2811
3
+ size 47545544