Spaces:
Runtime error
Runtime error
File size: 568 Bytes
e3d027a 33d5aa0 4ec77fa 33d5aa0 1262d0c ef7fcb2 33d5aa0 f002879 33d5aa0 f002879 33d5aa0 4ec77fa |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
__all__ = ['is_glaucoma', 'learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
from fastai.vision.all import *
import gradio as gr
def is_glaucoma(x): return x[0].isupper()
learn = load_learner('your_model.pkl')
categories = ('Glaucoma Present','Glaucoma Absent')
def predict(img):
pred,pred_idx,probs = learn.predict(img)
return dict(zip(categories, map(float,probs)))
image = gr.inputs.Image(shape=(512,512))
label = gr.outputs.Label()
intf = gr.Interface(fn=predict, inputs=image, outputs=label)
intf.launch(inline=False) |