Spaces:
Build error
Build error
import gradio as gr | |
from fastcore.all import * | |
import time | |
image = gr.inputs.Image(shape=(192,192)) | |
label = gr.outputs.Label() | |
examples = ['bmw_750.jpeg'] | |
categories = ['bmw car', 'mercedes car'] | |
learn.load_learner("export.kpl") | |
def classify_image(img): | |
pred, _, prob = learn.predict(img) | |
return dict(zip(categories, map(float, probs))) | |
intf = gr.Interface(fn=classify_image, inputs=image, outpluts=label, examples=examples) | |
intf.launch(inline=False) | |