Spaces:
Runtime error
Runtime error
File size: 513 Bytes
6320c2c 0a8d0e5 6320c2c 0a8d0e5 6320c2c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from fastai.vision.all import *
import gradio as gr
learn = load_learner('export.pkl')
catagories = 'apple','barn owl','guacamole','parrot',
def classify_img(img):
pred_class,pred_idx,probs = learn.predict(img)
return dict(zip(catagories, map(float,probs)))
image = gr.inputs.Image(shape=(256,256))
label = gr.outputs.Label()
examples = ['apple.png','owl.png','parrot.png','guacamole.png']
intf = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
intf.launch(share = True) |