Spaces:
Runtime error
Runtime error
#__all__ = ['Hyundai Venue','Maruti Suzuki Swift', 'Hyndai Creta', 'Hyundai i10', 'Maruti Suzuki WagonR', 'Maruti Suzuki Alto'] | |
from fastai.vision.all import * | |
import gradio as gr | |
def classify_image(img): | |
pred, idx, probs = learn.predict(img) | |
return dict(zip(categories, map(float, probs))) | |
learn = load_learner('model.pkl') | |
categories = ['Hyundai Venue','Maruti Suzuki Swift', 'Hyndai Creta', 'Hyundai i10', 'Maruti Suzuki WagonR', 'Maruti Suzuki Alto'] | |
image = gr.inputs.Image(shape=(192, 192)) | |
label = gr.outputs.Label() | |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label) | |
intf.launch(inline=False) |