Austin Andrews
Model
5efa886
raw
history blame
468 Bytes
from fastai.vision.all import *
import gradio as gr
learn = load_learner('model.pkl')
categories = ('eczema', 'ringworm')
def classify_image(img):
pred, idx, probs = learn.predict(img)
return dict(zip(categories, map(float, probs)))
image = gr.inputs.Image(shape=(128,128))
label = gr.outputs.Label()
examples = ['eczema.jpg', 'ringworm.jpg']
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
intf.launch(inline=False)