Spaces:
Runtime error
Runtime error
Commit
路
1497a09
1
Parent(s):
5eafa5b
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,8 @@ def image_to_silhouette(image):
|
|
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 |
-
|
|
|
29 |
|
30 |
# Funci贸n para manejar el evento de submit
|
31 |
def on_submit(inputs):
|
@@ -39,18 +40,4 @@ def on_submit(inputs):
|
|
39 |
submit_button.on_submit(on_submit)
|
40 |
|
41 |
# Mostrar interfaz
|
42 |
-
interface.launch()
|
43 |
-
|
44 |
-
examples = [
|
45 |
-
{"input": "https://images.pexels.com/photos/414612/pexels-photo-414612.jpeg", "output": "https://images.pexels.com/photos/414612/pexels-photo-414612.jpeg"}
|
46 |
-
]
|
47 |
-
gr.Interface(
|
48 |
-
image_to_silhouette,
|
49 |
-
[gr.inputs.Image(label="Input")],
|
50 |
-
gr.outputs.Image(label="Output"),
|
51 |
-
examples=examples
|
52 |
-
).launch(debug=True)
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
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):
|
|
|
40 |
submit_button.on_submit(on_submit)
|
41 |
|
42 |
# Mostrar interfaz
|
43 |
+
interface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|