Spaces:
Running
Running
placeholder
Browse files- .gitattributes +3 -0
- app.py +80 -4
- data/examples/garment_example.png +3 -0
- data/examples/person_example.png +3 -0
- data/examples/result_example.png +3 -0
- data/garment/garment_1.png +3 -0
- data/person/person_1.png +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,6 @@ 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 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
37 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
38 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -1,8 +1,84 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
|
4 |
+
# assets loading
|
5 |
+
example_path = os.path.join(os.path.dirname(__file__), 'data')
|
6 |
|
7 |
+
garm_list = os.listdir(os.path.join(example_path,"garment"))
|
8 |
+
garm_list_path = [os.path.join(example_path, "garment", garm) for garm in garm_list]
|
9 |
|
10 |
+
person_list = os.listdir(os.path.join(example_path,"person"))
|
11 |
+
person_list_path = [os.path.join(example_path, "person", person) for person in person_list]
|
12 |
+
|
13 |
+
def run_turbo(person_img, garm_img, category):
|
14 |
+
pass
|
15 |
+
|
16 |
+
with gr.Blocks() as Huhu_Turbo:
|
17 |
+
with gr.Row():
|
18 |
+
with gr.Column(elem_id = "col-garment"):
|
19 |
+
gr.HTML("""
|
20 |
+
<div style="display: flex; justify-content: center; align-items: center; text-align: center; font-size: 20px;">
|
21 |
+
<div>
|
22 |
+
Upload your garment image 🧥
|
23 |
+
</div>
|
24 |
+
</div>
|
25 |
+
""")
|
26 |
+
with gr.Column(elem_id = "col-person"):
|
27 |
+
gr.HTML("""
|
28 |
+
<div style="display: flex; justify-content: center; align-items: center; text-align: center; font-size: 20px;">
|
29 |
+
<div>
|
30 |
+
Select a model image 🧍
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
""")
|
34 |
+
with gr.Column(elem_id = "col-result"):
|
35 |
+
gr.HTML("""
|
36 |
+
<div style="display: flex; justify-content: center; align-items: center; text-align: center; font-size: 20px;">
|
37 |
+
<div>
|
38 |
+
“RUN” to get results 🪄
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
""")
|
42 |
+
with gr.Row():
|
43 |
+
with gr.Column(elem_id = "col-garment"):
|
44 |
+
garm_img = gr.Image(label="Garment image", sources='upload', type="numpy")
|
45 |
+
category = gr.Dropdown(label="Garment type", choices=['Top', 'Bottom', 'Fullbody'], value="Top")
|
46 |
+
example = gr.Examples(
|
47 |
+
inputs=garm_img,
|
48 |
+
examples_per_page=6,
|
49 |
+
examples=garm_list_path
|
50 |
+
)
|
51 |
+
with gr.Column(elem_id = "col-person"):
|
52 |
+
person_img = gr.Image(label="Person image", sources='upload', type="numpy")
|
53 |
+
example = gr.Examples(
|
54 |
+
inputs=person_img,
|
55 |
+
examples_per_page=6,
|
56 |
+
examples=person_list_path
|
57 |
+
)
|
58 |
+
with gr.Column(elem_id = "col-result"):
|
59 |
+
result_img = gr.Image(label="Result", show_share_button=False)
|
60 |
+
with gr.Row():
|
61 |
+
result_info = gr.Text(label="Generation time")
|
62 |
+
generate_button = gr.Button(value="“RUN”", elem_id="button")
|
63 |
+
|
64 |
+
generate_button.click(fn=run_turbo, inputs=[person_img, garm_img, category], outputs=[result_img, result_info], api_name=False, concurrency_limit=30)
|
65 |
+
|
66 |
+
with gr.Column(elem_id = "col-showcase"):
|
67 |
+
gr.HTML("""
|
68 |
+
<div style="display: flex; justify-content: center; align-items: center; text-align: center; font-size: 20px;">
|
69 |
+
<div> </div>
|
70 |
+
<br>
|
71 |
+
<div>
|
72 |
+
Huhu-turbo try-on examples in pairs of garment and person images
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
""")
|
76 |
+
show_case = gr.Examples(
|
77 |
+
examples=[
|
78 |
+
["data/examples/garment_example.png", "data/examples/person_example.png", "data/examples/result_example.png"],
|
79 |
+
],
|
80 |
+
inputs=[person_img, garm_img, result_img],
|
81 |
+
label=None
|
82 |
+
)
|
83 |
+
|
84 |
+
Huhu_Turbo.queue(api_open=False).launch(show_api=False)
|
data/examples/garment_example.png
ADDED
![]() |
Git LFS Details
|
data/examples/person_example.png
ADDED
![]() |
Git LFS Details
|
data/examples/result_example.png
ADDED
![]() |
Git LFS Details
|
data/garment/garment_1.png
ADDED
![]() |
Git LFS Details
|
data/person/person_1.png
ADDED
![]() |
Git LFS Details
|