Spaces:
Runtime error
Runtime error
archietram
commited on
Commit
•
a33db3f
1
Parent(s):
01dde5e
app.py
Browse files- 002c21358ce6_noDR.png +0 -0
- 0182152c50de_noDR.png +0 -0
- 0ceb222f6629_DR.png +0 -0
- 15bed5adde74_DR.png +0 -0
- app.py +21 -0
- requirements.txt +1 -0
002c21358ce6_noDR.png
ADDED
0182152c50de_noDR.png
ADDED
0ceb222f6629_DR.png
ADDED
15bed5adde74_DR.png
ADDED
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
|
5 |
+
learn = load_learner("export.pkl")
|
6 |
+
|
7 |
+
categories = ("Diabetic Retinopathy", "No Diabetic Retinopathy")
|
8 |
+
|
9 |
+
def classify_image(img):
|
10 |
+
pred,idx,probs = learn.predict(img)
|
11 |
+
return dict(zip(categories, map(float,probs)))
|
12 |
+
|
13 |
+
image = gr.inputs.Image(shape=(192,192))
|
14 |
+
label = gr.outputs.Label()
|
15 |
+
examples = ['002c21358ce6_noDR.png','0182152c50de_noDR.png','15bed5adde74_DR.png', '0ceb222f6629_DR.png']
|
16 |
+
title = 'Diabetic Retinopathy Predictor'
|
17 |
+
description = 'This app predicts diabetic retinopathy, a potentially blinding disease, from color fundus photograms. For reference only.'
|
18 |
+
article = "Author: <a href=\"https://huggingface.co/archietram\">Archie Tram</a>. "
|
19 |
+
|
20 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, title=title, description=description, article=article)
|
21 |
+
intf.launch(inline=False)
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fastai
|