tiger3 / app.py
Mahbubur's picture
Tiger model added
d547c18
raw
history blame
No virus
430 Bytes
from fastai.vision.all import *
import gradio as gr
learn = load_learner('tiger-model.pkl')
categories = ('Bengal', 'Siberian', 'White')
def classify_img(img):
preds, idx, probs = learn.predict(img)
return dict(zip(categories, map(float, probs)))
image = gr.Image(shape=(192, 192))
label = gr.Label()
examples = []
iface = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
iface.launch()