Spaces:
Running
Running
risunobushi
commited on
Commit
Β·
2f6e42e
1
Parent(s):
64bda64
Restructure layout: align example images below corresponding input fields
Browse files
app.py
CHANGED
@@ -288,7 +288,11 @@ with gr.Blocks(title="YOURMIRROR.IO - SM4LL-VTON Demo") as demo:
|
|
288 |
IMG_SIZE = 256
|
289 |
|
290 |
with gr.Row():
|
291 |
-
# Left column
|
|
|
|
|
|
|
|
|
292 |
with gr.Column(scale=1):
|
293 |
base_in = gr.Image(
|
294 |
label="Base Image",
|
@@ -296,86 +300,85 @@ with gr.Blocks(title="YOURMIRROR.IO - SM4LL-VTON Demo") as demo:
|
|
296 |
height=IMG_SIZE,
|
297 |
width=IMG_SIZE,
|
298 |
)
|
299 |
-
|
300 |
-
label="Product Image",
|
301 |
-
type="pil",
|
302 |
-
height=IMG_SIZE,
|
303 |
-
width=IMG_SIZE,
|
304 |
-
)
|
305 |
-
|
306 |
-
# Centre column β result image (larger)
|
307 |
-
with gr.Column(scale=2):
|
308 |
-
result_out = gr.Image(
|
309 |
-
label="Result",
|
310 |
-
height=512,
|
311 |
-
width=512,
|
312 |
-
)
|
313 |
-
|
314 |
-
# Right column β workflow selector and Generate button
|
315 |
-
with gr.Column(scale=1, elem_classes="control-column"):
|
316 |
-
workflow_selector = gr.Radio(
|
317 |
-
choices=[
|
318 |
-
("Eyewear", "eyewear"),
|
319 |
-
("Footwear", "footwear"),
|
320 |
-
("Full-Body Garment", "dress"),
|
321 |
-
],
|
322 |
-
value="eyewear",
|
323 |
-
label="Model",
|
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=
|
336 |
-
width=
|
337 |
show_label=False,
|
338 |
)
|
339 |
base_example_2 = gr.Image(
|
340 |
value="assets/base_image-2.jpg",
|
341 |
interactive=False,
|
342 |
-
height=
|
343 |
-
width=
|
344 |
show_label=False,
|
345 |
)
|
346 |
base_example_3 = gr.Image(
|
347 |
value="assets/base_image-3.jpg",
|
348 |
interactive=False,
|
349 |
-
height=
|
350 |
-
width=
|
351 |
show_label=False,
|
352 |
)
|
353 |
-
|
354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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=
|
361 |
-
width=
|
362 |
show_label=False,
|
363 |
)
|
364 |
product_example_2 = gr.Image(
|
365 |
value="assets/product_image-2.jpg",
|
366 |
interactive=False,
|
367 |
-
height=
|
368 |
-
width=
|
369 |
show_label=False,
|
370 |
)
|
371 |
product_example_3 = gr.Image(
|
372 |
value="assets/product_image-3.jpg",
|
373 |
interactive=False,
|
374 |
-
height=
|
375 |
-
width=
|
376 |
show_label=False,
|
377 |
)
|
378 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
# Wire up interaction
|
380 |
generate_btn.click(
|
381 |
generate,
|
|
|
288 |
IMG_SIZE = 256
|
289 |
|
290 |
with gr.Row():
|
291 |
+
# Left spacer column
|
292 |
+
with gr.Column(scale=1):
|
293 |
+
pass
|
294 |
+
|
295 |
+
# Base image column
|
296 |
with gr.Column(scale=1):
|
297 |
base_in = gr.Image(
|
298 |
label="Base Image",
|
|
|
300 |
height=IMG_SIZE,
|
301 |
width=IMG_SIZE,
|
302 |
)
|
303 |
+
# Base image examples directly below
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
gr.Markdown("### base image examples")
|
305 |
with gr.Row():
|
306 |
base_example_1 = gr.Image(
|
307 |
value="assets/base_image-1.jpg",
|
308 |
interactive=False,
|
309 |
+
height=120,
|
310 |
+
width=120,
|
311 |
show_label=False,
|
312 |
)
|
313 |
base_example_2 = gr.Image(
|
314 |
value="assets/base_image-2.jpg",
|
315 |
interactive=False,
|
316 |
+
height=120,
|
317 |
+
width=120,
|
318 |
show_label=False,
|
319 |
)
|
320 |
base_example_3 = gr.Image(
|
321 |
value="assets/base_image-3.jpg",
|
322 |
interactive=False,
|
323 |
+
height=120,
|
324 |
+
width=120,
|
325 |
show_label=False,
|
326 |
)
|
327 |
+
|
328 |
+
# Product image column
|
329 |
+
with gr.Column(scale=1):
|
330 |
+
garment_in = gr.Image(
|
331 |
+
label="Product Image",
|
332 |
+
type="pil",
|
333 |
+
height=IMG_SIZE,
|
334 |
+
width=IMG_SIZE,
|
335 |
+
)
|
336 |
+
# Product image examples directly below
|
337 |
gr.Markdown("### product examples")
|
338 |
with gr.Row():
|
339 |
product_example_1 = gr.Image(
|
340 |
value="assets/product_image-1.jpg",
|
341 |
interactive=False,
|
342 |
+
height=120,
|
343 |
+
width=120,
|
344 |
show_label=False,
|
345 |
)
|
346 |
product_example_2 = gr.Image(
|
347 |
value="assets/product_image-2.jpg",
|
348 |
interactive=False,
|
349 |
+
height=120,
|
350 |
+
width=120,
|
351 |
show_label=False,
|
352 |
)
|
353 |
product_example_3 = gr.Image(
|
354 |
value="assets/product_image-3.jpg",
|
355 |
interactive=False,
|
356 |
+
height=120,
|
357 |
+
width=120,
|
358 |
show_label=False,
|
359 |
)
|
360 |
|
361 |
+
# Result column
|
362 |
+
with gr.Column(scale=2):
|
363 |
+
result_out = gr.Image(
|
364 |
+
label="Result",
|
365 |
+
height=512,
|
366 |
+
width=512,
|
367 |
+
)
|
368 |
+
|
369 |
+
# Controls column
|
370 |
+
with gr.Column(scale=1):
|
371 |
+
workflow_selector = gr.Radio(
|
372 |
+
choices=[
|
373 |
+
("Eyewear", "eyewear"),
|
374 |
+
("Footwear", "footwear"),
|
375 |
+
("Full-Body Garment", "dress"),
|
376 |
+
],
|
377 |
+
value="eyewear",
|
378 |
+
label="Model",
|
379 |
+
)
|
380 |
+
generate_btn = gr.Button("Generate", variant="primary", size="lg")
|
381 |
+
|
382 |
# Wire up interaction
|
383 |
generate_btn.click(
|
384 |
generate,
|