dyadd commited on
Commit
326ba97
1 Parent(s): f84af87

added save

Browse files
Files changed (4) hide show
  1. app.py +20 -0
  2. glaucoma.png +0 -0
  3. model2.pkl +3 -0
  4. not glaucoma.png +0 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+
4
+ def is_glaucoma(x): return x[6] == 'g'
5
+
6
+ learn = load_learner('model2.pkl')
7
+
8
+ categories = ('Glaucoma', 'not Glaucoma')
9
+
10
+ def classify_image(img):
11
+ pred,idx,probs = learn.predict(img)
12
+ return dict(zip(categories, map(float,probs)))
13
+
14
+ image = gr.components.Image(height=192, width=192)
15
+ label = gr.components.Label()
16
+ examples = ['glaucoma.jpg', 'not glaucoma.jpg']
17
+
18
+
19
+ intf=gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
20
+ intf.launch(inline=False)
glaucoma.png ADDED
model2.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d5853853f94517f360a04b4891283a195440f25d5e8745e815d552c563744d7
3
+ size 46968333
not glaucoma.png ADDED