Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -322,71 +322,68 @@ def app_gradio():
|
|
322 |
|
323 |
# define root_path
|
324 |
root_path = "resource/demo/example"
|
|
|
325 |
# First column
|
326 |
with gr.Column(scale=1, min_width=350):
|
327 |
# Person image
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
# # Display text
|
387 |
-
# gr.Markdown(
|
388 |
-
# '<span style="color: #808080; font-size: small;">*Condition examples come from the Internet. </span>'
|
389 |
-
# )
|
390 |
|
391 |
# Second column
|
392 |
with gr.Column(scale=1, min_width=350):
|
|
|
322 |
|
323 |
# define root_path
|
324 |
root_path = "resource/demo/example"
|
325 |
+
|
326 |
# First column
|
327 |
with gr.Column(scale=1, min_width=350):
|
328 |
# Person image
|
329 |
+
image_path = gr.Image(
|
330 |
+
type="filepath",
|
331 |
+
interactive=True,
|
332 |
+
visible=False,
|
333 |
+
)
|
334 |
+
person_image = gr.ImageEditor(
|
335 |
+
interactive=True, label="Person Image", type="filepath"
|
336 |
+
)
|
337 |
+
|
338 |
+
# Mask instruction
|
339 |
+
gr.Markdown(
|
340 |
+
'<span style="color: #808080; font-size: small;">Two ways to provide Mask:<br>1. Upload the person image and use the `🖌️` above to draw the Mask (higher priority)<br>2. Select the `Try-On Cloth Type` to generate automatically </span>'
|
341 |
+
)
|
342 |
+
cloth_type = gr.Radio(
|
343 |
+
label="Try-On Cloth Type",
|
344 |
+
choices=["upper", "lower", "overall"],
|
345 |
+
value="upper",
|
346 |
+
)
|
347 |
+
|
348 |
+
# Model column examples
|
349 |
+
# Men examples
|
350 |
+
men_exm = gr.Examples(
|
351 |
+
examples=[
|
352 |
+
os.path.join(root_path, "person", "men", _)
|
353 |
+
for _ in os.listdir(os.path.join(root_path, "person", "men"))
|
354 |
+
],
|
355 |
+
examples_per_page=4,
|
356 |
+
inputs=image_path,
|
357 |
+
label="Person Examples ①",
|
358 |
+
)
|
359 |
+
# Women examples
|
360 |
+
women_exm = gr.Examples(
|
361 |
+
examples=[
|
362 |
+
os.path.join(root_path, "person", "women", _)
|
363 |
+
for _ in os.listdir(os.path.join(root_path, "person", "women"))
|
364 |
+
],
|
365 |
+
examples_per_page=4,
|
366 |
+
inputs=image_path,
|
367 |
+
label="Person Examples ②",
|
368 |
+
)
|
369 |
+
# Markdown: component display text in Gradio
|
370 |
+
gr.Markdown(
|
371 |
+
'<span style="color: #808080; font-size: small;">*Person examples come from the demos of <a href="https://huggingface.co/spaces/levihsu/OOTDiffusion">OOTDiffusion</a> and <a href="https://www.outfitanyone.org">OutfitAnyone</a>. </span>'
|
372 |
+
)
|
373 |
+
# # Person pose example
|
374 |
+
# condition_person_exm = gr.Examples(
|
375 |
+
# examples=[
|
376 |
+
# os.path.join(root_path, "condition", "person", _)
|
377 |
+
# for _ in os.listdir(os.path.join(root_path, "condition", "person"))
|
378 |
+
# ],
|
379 |
+
# examples_per_page=4,
|
380 |
+
# inputs=cloth_image,
|
381 |
+
# label="Condition Reference Person Examples",
|
382 |
+
# )
|
383 |
+
# # Display text
|
384 |
+
# gr.Markdown(
|
385 |
+
# '<span style="color: #808080; font-size: small;">*Condition examples come from the Internet. </span>'
|
386 |
+
# )
|
|
|
|
|
|
|
|
|
387 |
|
388 |
# Second column
|
389 |
with gr.Column(scale=1, min_width=350):
|