Spaces:
Runtime error
Runtime error
File size: 364 Bytes
cf6e1a5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from fastai.vision.all import *
import gradio as gr
learn = load_learner("model.pkl")
categories = ('Guitar','Piano')
def classify_image(image):
outcome,idx,probs = learn.predict(image)
return dict(zip(categories,map(float,probs)))
iface = gr.Interface(
fn = classify_image,
inputs = "image",
outputs = gr.outputs.Label()
)
iface.launch() |