Spaces:
Sleeping
Sleeping
File size: 529 Bytes
6cabcef 62eb46f 54258b8 94f4430 54258b8 94f4430 f61f1c0 32730a8 7e15f9e 94f4430 6cabcef 10975e7 6cabcef |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
__all__ = ['learn', 'classicy_image', 'categories', 'image', 'label', 'examples', 'intf']
from fastai.vision.all import *
import gradio as gr
learn = load_learner('mnist_model.pkl')
def classify_image(img):
pred,idx,probs = learn.predict(img)
return pred
image = gr.Image(width=192, height=192)
label = gr.Label()
examples = ["5.png"]
#intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
intf.launch(inline=False) |