Spaces:
Sleeping
Sleeping
File size: 548 Bytes
6b15195 b7bd92d 6b15195 b7bd92d 6b15195 b7bd92d 6b15195 b7bd92d 6b15195 b7bd92d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | from fastai.vision.all import *
import gradio as gr
learn = load_learner("export.pkl")
labels = learn.dls.vocab
def clasificar(img):
pred_class, _, probs = learn.predict(img)
return {str(l): float(p) for l, p in zip(labels, probs)}
# Interfaz simplificada para asegurar el despliegue
gr.Interface(
fn=clasificar,
inputs=gr.Image(type="pil", label="Imagen del perro"),
outputs=gr.Label(num_top_classes=5),
title="Clasificador de Razas de Perros 🐶",
description=f"Razas soportadas: {', '.join(labels)}"
).launch() |