JuanSv commited on
Commit
ca5c082
·
verified ·
1 Parent(s): fc77fbe

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -23
app.py DELETED
@@ -1,23 +0,0 @@
1
- from fastai.vision.all import load_learner, PILImage
2
- import gradio as gr
3
-
4
- # Cargar el modelo
5
- learn = load_learner("model.pkl")
6
- labels = learn.dls.vocab
7
-
8
- # Función de predicción
9
- def predict(img):
10
- img = PILImage.create(img)
11
- pred, pred_idx, probs = learn.predict(img)
12
- return {labels[i]: float(probs[i]) for i in range(len(labels))}
13
-
14
- # Crear la interfaz Gradio
15
- demo = gr.Interface(
16
- fn=predict,
17
- inputs=gr.Image(type="filepath"),
18
- outputs=gr.Label(num_top_classes=3),
19
- title="Lab Utensils Classifier",
20
- description="Clasificador de utensilios de laboratorio"
21
- )
22
-
23
- demo.launch()