Spaces:
Runtime error
Runtime error
#|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))) | |