first_model / app.py.197bbcc06daf9e04d14c423527374e94.tmp
moadams's picture
installed additional packages
df6517b
raw
history blame
492 Bytes
#|export
from fastai.vision.all import *
import gradio as gr
from fastbook import *
def is_cat(x): return x[0].isupper()
#|export
learn = load_learner('model.pkl')
#|export
categories = ('Dog', 'Cat')
def classify_image(im):
pred, idx, probs = learn.predict(im)
return dict(zip(categories, map(float, probs)))
#|export
categories = ('Dog', 'Cat')
def classify_image(im):
pred, idx, probs = learn.predict(im)
return dict(zip(categories, map(float, probs)))