File size: 459 Bytes
3c92de6
997dd91
 
3c92de6
6d59a4b
31ec730
 
997dd91
 
 
 
 
 
 
3c92de6
31ec730
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)