risunobushi commited on
Commit
a191678
·
1 Parent(s): dbe2e1e

Add full-body garment functionality and example images UI with LFS

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.jpg filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -324,12 +324,73 @@ with gr.Blocks(title="YOURMIRROR.IO - SM4LL-VTON Demo") as demo:
324
  )
325
  generate_btn = gr.Button("Generate", variant="primary", size="lg")
326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  # Wire up interaction
328
  generate_btn.click(
329
  generate,
330
  inputs=[base_in, garment_in, workflow_selector],
331
  outputs=result_out,
332
  )
 
 
 
 
 
 
 
 
 
333
 
334
  # Run app if executed directly (e.g. `python app.py`). HF Spaces launches via
335
  # `python app.py` automatically if it finds `app.py` at repo root, but our file
 
324
  )
325
  generate_btn = gr.Button("Generate", variant="primary", size="lg")
326
 
327
+ # Example images section
328
+ with gr.Row():
329
+ with gr.Column():
330
+ gr.Markdown("### base image examples")
331
+ with gr.Row():
332
+ base_example_1 = gr.Image(
333
+ value="assets/base_image-1.jpg",
334
+ interactive=False,
335
+ height=150,
336
+ width=150,
337
+ show_label=False,
338
+ )
339
+ base_example_2 = gr.Image(
340
+ value="assets/base_image-2.jpg",
341
+ interactive=False,
342
+ height=150,
343
+ width=150,
344
+ show_label=False,
345
+ )
346
+ base_example_3 = gr.Image(
347
+ value="assets/base_image-3.jpg",
348
+ interactive=False,
349
+ height=150,
350
+ width=150,
351
+ show_label=False,
352
+ )
353
+
354
+ with gr.Column():
355
+ gr.Markdown("### product examples")
356
+ with gr.Row():
357
+ product_example_1 = gr.Image(
358
+ value="assets/product_image-1.jpg",
359
+ interactive=False,
360
+ height=150,
361
+ width=150,
362
+ show_label=False,
363
+ )
364
+ product_example_2 = gr.Image(
365
+ value="assets/product_image-2.jpg",
366
+ interactive=False,
367
+ height=150,
368
+ width=150,
369
+ show_label=False,
370
+ )
371
+ product_example_3 = gr.Image(
372
+ value="assets/product_image-3.jpg",
373
+ interactive=False,
374
+ height=150,
375
+ width=150,
376
+ show_label=False,
377
+ )
378
+
379
  # Wire up interaction
380
  generate_btn.click(
381
  generate,
382
  inputs=[base_in, garment_in, workflow_selector],
383
  outputs=result_out,
384
  )
385
+
386
+ # Click handlers for example images
387
+ base_example_1.click(lambda: Image.open("assets/base_image-1.jpg"), outputs=base_in)
388
+ base_example_2.click(lambda: Image.open("assets/base_image-2.jpg"), outputs=base_in)
389
+ base_example_3.click(lambda: Image.open("assets/base_image-3.jpg"), outputs=base_in)
390
+
391
+ product_example_1.click(lambda: Image.open("assets/product_image-1.jpg"), outputs=garment_in)
392
+ product_example_2.click(lambda: Image.open("assets/product_image-2.jpg"), outputs=garment_in)
393
+ product_example_3.click(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
assets/base_image-1.jpg ADDED

Git LFS Details

  • SHA256: 21e0d6e046693e5cc267eb7c8d0e993eee67913d07cdcc5d4ba475f4cdb0dbe2
  • Pointer size: 132 Bytes
  • Size of remote file: 1.6 MB
assets/base_image-2.jpg ADDED

Git LFS Details

  • SHA256: 473c17843d5d3a823f995ba2084e31295358950dc1edad1e7980e947c02c8241
  • Pointer size: 132 Bytes
  • Size of remote file: 5.38 MB
assets/base_image-3.jpg ADDED

Git LFS Details

  • SHA256: 2b0aae60e1aa25c7b418a40c48365e95cf005a546220555a5a2416ba9fce8d5e
  • Pointer size: 132 Bytes
  • Size of remote file: 5.47 MB
assets/product_image-1.jpg ADDED

Git LFS Details

  • SHA256: f700c46121359e1ae9f48ba8ac35b4fa5ad27f941da57338de032b428ea6cf3b
  • Pointer size: 131 Bytes
  • Size of remote file: 499 kB
assets/product_image-2.jpg ADDED

Git LFS Details

  • SHA256: 60c64d80618ee8b42e7a1755dd724cad5c7a858604df5e5f457c4c64508699f1
  • Pointer size: 131 Bytes
  • Size of remote file: 387 kB
assets/product_image-3.jpg ADDED

Git LFS Details

  • SHA256: e05a1a7ec1c40620486919b8385d7483c8c6e3dfb7d2c46460036ee54bc7357c
  • Pointer size: 132 Bytes
  • Size of remote file: 1.25 MB