Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -408,73 +408,72 @@ def app_gradio():
|
|
408 |
result_image = gr.Image(
|
409 |
interactive=False,
|
410 |
label="Final Result",
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
)
|
478 |
|
479 |
image_path.change(
|
480 |
person_example_fn,
|
|
|
408 |
result_image = gr.Image(
|
409 |
interactive=False,
|
410 |
label="Final Result",
|
411 |
+
elem_classes="image-container"
|
412 |
+
)
|
413 |
+
with gr.Row():
|
414 |
+
# Photo Examples
|
415 |
+
root_path = "resource/demo/example"
|
416 |
+
with gr.Column():
|
417 |
+
gr.Markdown("#### 👤 Model Examples")
|
418 |
+
men_exm = gr.Examples(
|
419 |
+
examples=[
|
420 |
+
os.path.join(root_path, "person", "men", _)
|
421 |
+
for _ in os.listdir(os.path.join(root_path, "person", "men"))
|
422 |
+
],
|
423 |
+
examples_per_page=4,
|
424 |
+
inputs=image_path,
|
425 |
+
label="Men's Examples",
|
426 |
+
elem_classes="example-item"
|
427 |
+
)
|
428 |
+
women_exm = gr.Examples(
|
429 |
+
examples=[
|
430 |
+
os.path.join(root_path, "person", "women", _)
|
431 |
+
for _ in os.listdir(os.path.join(root_path, "person", "women"))
|
432 |
+
],
|
433 |
+
examples_per_page=4,
|
434 |
+
inputs=image_path,
|
435 |
+
label="Women's Examples",
|
436 |
+
elem_classes="example-item"
|
437 |
+
)
|
438 |
+
gr.Markdown(
|
439 |
+
'<div class="info-text">Model examples courtesy of <a href="https://huggingface.co/spaces/levihsu/OOTDiffusion">OOTDiffusion</a> and <a href="https://www.outfitanyone.org">OutfitAnyone</a></div>'
|
440 |
+
)
|
441 |
+
|
442 |
+
with gr.Column():
|
443 |
+
gr.Markdown("#### 👕 Clothing Examples")
|
444 |
+
condition_upper_exm = gr.Examples(
|
445 |
+
examples=[
|
446 |
+
os.path.join(root_path, "condition", "upper", _)
|
447 |
+
for _ in os.listdir(os.path.join(root_path, "condition", "upper"))
|
448 |
+
],
|
449 |
+
examples_per_page=4,
|
450 |
+
inputs=cloth_image,
|
451 |
+
label="Upper Garments",
|
452 |
+
elem_classes="example-item"
|
453 |
+
)
|
454 |
+
condition_overall_exm = gr.Examples(
|
455 |
+
examples=[
|
456 |
+
os.path.join(root_path, "condition", "overall", _)
|
457 |
+
for _ in os.listdir(os.path.join(root_path, "condition", "overall"))
|
458 |
+
],
|
459 |
+
examples_per_page=4,
|
460 |
+
inputs=cloth_image,
|
461 |
+
label="Full Outfits",
|
462 |
+
elem_classes="example-item"
|
463 |
+
)
|
464 |
+
condition_person_exm = gr.Examples(
|
465 |
+
examples=[
|
466 |
+
os.path.join(root_path, "condition", "person", _)
|
467 |
+
for _ in os.listdir(os.path.join(root_path, "condition", "person"))
|
468 |
+
],
|
469 |
+
examples_per_page=4,
|
470 |
+
inputs=cloth_image,
|
471 |
+
label="Reference Styles",
|
472 |
+
elem_classes="example-item"
|
473 |
+
)
|
474 |
+
gr.Markdown(
|
475 |
+
'<div class="info-text">Clothing examples sourced from various online retailers</div>'
|
476 |
+
)
|
|
|
477 |
|
478 |
image_path.change(
|
479 |
person_example_fn,
|