tomaseo2022 commited on
Commit
f4d619e
1 Parent(s): 1497a09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -19
app.py CHANGED
@@ -22,22 +22,9 @@ def image_to_silhouette(image):
22
  return silhouette
23
 
24
  # Crear interfaz de usuario con Gradio
25
- interface = gr.Interface(fn=image_to_silhouette, inputs=gr.inputs.Image(label="Input"), outputs=gr.outputs.Image(label="Output", type="pil"), live=True)
26
-
27
- # A帽adir bot贸n de submit
28
- interface.inputs["image"].add_feature("submit", type="custom", custom_html='<button id="submit_button" class="gr-btn gr-btn-primary" type="button">Convertir</button>')
29
- interface.inputs["image"].add_event("submit_button", "click", on_submit)
30
-
31
- # Funci贸n para manejar el evento de submit
32
- def on_submit(inputs):
33
- # Obtener imagen de la caja de entrada
34
- image = inputs["image"]
35
- # Convertir imagen a silueta y mostrar en la caja de salida
36
- silhouette = image_to_silhouette(image)
37
- return silhouette
38
-
39
- # A帽adir evento de submit al bot贸n
40
- submit_button.on_submit(on_submit)
41
-
42
- # Mostrar interfaz
43
- interface.launch()
 
22
  return silhouette
23
 
24
  # Crear interfaz de usuario con Gradio
25
+ gr.Interface(
26
+ inference,
27
+ gr.inputs.Image(type="filepath", label="Input"),
28
+ gr.outputs.Image(type="pil", label="Output"),
29
+ css="Footer {visibility: hidden}"
30
+ ).launch()