MNIST_test / app.py
michael20at's picture
Add application file
94f4430
raw
history blame
373 Bytes
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.inputs.Image(shape=(192,192))
label = gr.outputs.Label()
examples = []
iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
iface.launch(inline=False)