aiqcamp commited on
Commit
0b8361c
·
verified ·
1 Parent(s): c447701

Update app.py

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