Spaces:
Running
Running
risunobushi
commited on
Commit
·
64bda64
1
Parent(s):
a191678
Fix image event handlers - use select instead of click
Browse files
app.py
CHANGED
|
@@ -383,14 +383,14 @@ with gr.Blocks(title="YOURMIRROR.IO - SM4LL-VTON Demo") as demo:
|
|
| 383 |
outputs=result_out,
|
| 384 |
)
|
| 385 |
|
| 386 |
-
#
|
| 387 |
-
base_example_1.
|
| 388 |
-
base_example_2.
|
| 389 |
-
base_example_3.
|
| 390 |
|
| 391 |
-
product_example_1.
|
| 392 |
-
product_example_2.
|
| 393 |
-
product_example_3.
|
| 394 |
|
| 395 |
# Run app if executed directly (e.g. `python app.py`). HF Spaces launches via
|
| 396 |
# `python app.py` automatically if it finds `app.py` at repo root, but our file
|
|
|
|
| 383 |
outputs=result_out,
|
| 384 |
)
|
| 385 |
|
| 386 |
+
# Select handlers for example images
|
| 387 |
+
base_example_1.select(lambda: Image.open("assets/base_image-1.jpg"), outputs=base_in)
|
| 388 |
+
base_example_2.select(lambda: Image.open("assets/base_image-2.jpg"), outputs=base_in)
|
| 389 |
+
base_example_3.select(lambda: Image.open("assets/base_image-3.jpg"), outputs=base_in)
|
| 390 |
|
| 391 |
+
product_example_1.select(lambda: Image.open("assets/product_image-1.jpg"), outputs=garment_in)
|
| 392 |
+
product_example_2.select(lambda: Image.open("assets/product_image-2.jpg"), outputs=garment_in)
|
| 393 |
+
product_example_3.select(lambda: Image.open("assets/product_image-3.jpg"), outputs=garment_in)
|
| 394 |
|
| 395 |
# Run app if executed directly (e.g. `python app.py`). HF Spaces launches via
|
| 396 |
# `python app.py` automatically if it finds `app.py` at repo root, but our file
|