刘云飞
commited on
Commit
·
b2c8dea
1
Parent(s):
3fd63f9
fix gr input issue
Browse files
app.py
CHANGED
|
@@ -274,7 +274,10 @@ with gr.Blocks(title="TEASER demo", css="""
|
|
| 274 |
gr.Markdown("---")
|
| 275 |
gr.Markdown("### Example Source Images (Click to use)")
|
| 276 |
with gr.Row(elem_classes=["scrollable-column"]):
|
| 277 |
-
|
|
|
|
|
|
|
|
|
|
| 278 |
for img in example_images:
|
| 279 |
img_path = os.path.join(IN_IMAGE_DIR, img)
|
| 280 |
with gr.Column(elem_classes=["image-container"]):
|
|
@@ -288,7 +291,10 @@ with gr.Blocks(title="TEASER demo", css="""
|
|
| 288 |
gr.Markdown("---")
|
| 289 |
gr.Markdown("### Example Driven Images (Click to use)")
|
| 290 |
with gr.Row(elem_classes=["scrollable-column"]):
|
| 291 |
-
|
|
|
|
|
|
|
|
|
|
| 292 |
for img in example_images:
|
| 293 |
img_path = os.path.join(IN_IMAGE_DIR, img)
|
| 294 |
with gr.Column(elem_classes=["image-container"]):
|
|
|
|
| 274 |
gr.Markdown("---")
|
| 275 |
gr.Markdown("### Example Source Images (Click to use)")
|
| 276 |
with gr.Row(elem_classes=["scrollable-column"]):
|
| 277 |
+
if os.path.exists(IN_IMAGE_DIR):
|
| 278 |
+
example_images = [f for f in sorted(os.listdir(IN_IMAGE_DIR)) if f.endswith(('.png', '.jpg', '.jpeg'))]
|
| 279 |
+
else:
|
| 280 |
+
example_images = []
|
| 281 |
for img in example_images:
|
| 282 |
img_path = os.path.join(IN_IMAGE_DIR, img)
|
| 283 |
with gr.Column(elem_classes=["image-container"]):
|
|
|
|
| 291 |
gr.Markdown("---")
|
| 292 |
gr.Markdown("### Example Driven Images (Click to use)")
|
| 293 |
with gr.Row(elem_classes=["scrollable-column"]):
|
| 294 |
+
if os.path.exists(IN_IMAGE_DIR):
|
| 295 |
+
example_images = [f for f in sorted(os.listdir(IN_IMAGE_DIR)) if f.endswith(('.png', '.jpg', '.jpeg'))]
|
| 296 |
+
else:
|
| 297 |
+
example_images = []
|
| 298 |
for img in example_images:
|
| 299 |
img_path = os.path.join(IN_IMAGE_DIR, img)
|
| 300 |
with gr.Column(elem_classes=["image-container"]):
|