Spaces:
Runtime error
Runtime error
from fastai.vision.all import * | |
import gradio as gr | |
learn_inf = load_learner("export.pkl") | |
categories = ('black', 'gizzly', 'teddy') | |
def classify_image(img): | |
pred, pred_index, probs = learn_inf.predict(img) | |
return dict(zip(categories, map(float, probs))) | |
image = gr.inputs.Image(shape=(192,192)) | |
label = gr.outputs.Label() | |
examples = ['ted.jpeg', 'bear.webp', 'aBear.jpeg'] | |
interface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples) | |
interface.launch(inline = False) | |