Spaces:
Runtime error
Runtime error
from fastai.vision.all import * | |
import gradio as gr | |
learn = load_learner('AIReco1.pkl') | |
guesting = ('bird','forest') | |
def prediction(img): | |
pred,idx,probs = learn.predict(PILImage.create(img)) | |
return dict(zip(guesting, map(float,probs))) | |
image = gr.inputs.Image(shape=(192, 192)) | |
label = gr.outputs.Label() | |
examples = ['bird7.jpg', 'forest3.jpg'] | |
intf = gr.Interface(fn=prediction, inputs=image, outputs=label, examples=examples) | |
intf.launch(inline=False) |