first_model / app.py
moadams's picture
final script
3e381d9
raw
history blame
494 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)))