alezsd commited on
Commit
bb093b4
·
1 Parent(s): 509c851
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -24,14 +24,23 @@ def predict_image(img):
24
 
25
 
26
  # Interfaz Gradio
 
 
 
 
 
 
 
27
  demo = gr.Interface(
28
- fn=predict_image,
29
- inputs=gr.Image(type="pil"), # ← type="pil" = PIL.Image object
 
 
 
 
30
  outputs=gr.Textbox(label="Predicción"),
31
- title="🖋️ Clasificador Caligrafía CRNN",
32
- examples=None # Agrega ejemplos después
33
  )
34
 
35
-
36
  if __name__ == "__main__":
37
  demo.launch()
 
24
 
25
 
26
  # Interfaz Gradio
27
+ #demo = gr.Interface(
28
+ # fn=predict_image,
29
+ # inputs=gr.Image(type="pil"), # ← type="pil" = PIL.Image object
30
+ # outputs=gr.Textbox(label="Predicción"),
31
+ # title="🖋️ Clasificador Caligrafía CRNN",
32
+ # examples=None # Agrega ejemplos después
33
+ #)
34
  demo = gr.Interface(
35
+ fn=predict_image, # Tu función que espera image_path (str)
36
+ inputs=gr.Image(
37
+ type="filepath", # ← DEVUELVE RUTA ARCHIVO (string)
38
+ image_mode="RGB", # ← Fuerza RGB exacto
39
+ label="🖼️ Imagen"
40
+ ),
41
  outputs=gr.Textbox(label="Predicción"),
42
+ title="🖋️ Clasificador Caligrafía CRNN"
 
43
  )
44
 
 
45
  if __name__ == "__main__":
46
  demo.launch()