Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
from fastai.vision.all import *
|
|
|
2 |
|
3 |
learn = load_learner('your_model.pkl')
|
4 |
|
@@ -6,9 +7,10 @@ categories = ('Glaucoma Present','Glaucoma Absent')
|
|
6 |
|
7 |
labels = learn.dls.vocab
|
8 |
def predict(img):
|
9 |
-
img = PILImage.create(img)
|
10 |
pred,pred_idx,probs = learn.predict(img)
|
11 |
return dict(zip(categories, map(float,probs)))
|
12 |
|
13 |
-
|
14 |
-
|
|
|
|
|
|
1 |
from fastai.vision.all import *
|
2 |
+
import gradio as gr
|
3 |
|
4 |
learn = load_learner('your_model.pkl')
|
5 |
|
|
|
7 |
|
8 |
labels = learn.dls.vocab
|
9 |
def predict(img):
|
|
|
10 |
pred,pred_idx,probs = learn.predict(img)
|
11 |
return dict(zip(categories, map(float,probs)))
|
12 |
|
13 |
+
image = gr.inputs.Image(shape=(512,512))
|
14 |
+
label = gr.outputs.Label()
|
15 |
+
intf = gr.Interface(fn=predict, inputs=image, outputs=label)
|
16 |
+
intf.launch(inline=False)
|