Spaces:
Runtime error
Runtime error
import gradio as gr | |
from fastai.vision.all import * | |
def is_cat(x): | |
return x[0].isupper() | |
def classifier(img): | |
categories = ('Perro','Gato') | |
pred,indexs,probs = learner.predict(img) | |
return dict(zip(categories,map(float,probs))) | |
learner = load_learner('cats.pkl') | |
demo = gr.Interface(fn=classifier, inputs="image", outputs="label") | |
demo.launch() |