bmw_or_mercedes / app.py
cvergnes's picture
wip
997dd91
raw
history blame
459 Bytes
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)