selfitcamera
commited on
Commit
•
c0675be
1
Parent(s):
f668959
update
Browse files
app.py
CHANGED
@@ -140,8 +140,7 @@ with gr.Blocks(css=css) as demo:
|
|
140 |
with gr.Column():
|
141 |
# pose_image = gr.Image(source='upload', value=pose_examples[0][1],
|
142 |
# type="numpy", label="")
|
143 |
-
pose_image = gr.Image(value=None,
|
144 |
-
type="numpy", label="")
|
145 |
pose_id = gr.Label(value=pose_examples[0][0], label="Pose Image", visible=False)
|
146 |
example_pose = gr.Examples(inputs=[pose_id, pose_image],
|
147 |
examples_per_page=3,
|
@@ -150,6 +149,7 @@ with gr.Blocks(css=css) as demo:
|
|
150 |
with gr.Column():
|
151 |
with gr.Column():
|
152 |
size_slider = gr.Slider(-2.5, 2.5, value=1, interactive=True, label="clothes size")
|
|
|
153 |
run_button = gr.Button(value="Run")
|
154 |
init_res = get_result_example(cloth_examples[0][0], pose_examples[0][0])
|
155 |
res_image = gr.Image(label="result image", value=None, type="filepath")
|
|
|
140 |
with gr.Column():
|
141 |
# pose_image = gr.Image(source='upload', value=pose_examples[0][1],
|
142 |
# type="numpy", label="")
|
143 |
+
pose_image = gr.Image(value=None, type="numpy", label="")
|
|
|
144 |
pose_id = gr.Label(value=pose_examples[0][0], label="Pose Image", visible=False)
|
145 |
example_pose = gr.Examples(inputs=[pose_id, pose_image],
|
146 |
examples_per_page=3,
|
|
|
149 |
with gr.Column():
|
150 |
with gr.Column():
|
151 |
size_slider = gr.Slider(-2.5, 2.5, value=1, interactive=True, label="clothes size")
|
152 |
+
tip_text = gr.Textbox(value="Please make sure to upload half-body or full-body Human photo! Uploading clothing photo without human body will cause the task to fail and no information will be returned!", interactive=False)
|
153 |
run_button = gr.Button(value="Run")
|
154 |
init_res = get_result_example(cloth_examples[0][0], pose_examples[0][0])
|
155 |
res_image = gr.Image(label="result image", value=None, type="filepath")
|
utils.py
CHANGED
@@ -26,7 +26,8 @@ os.makedirs(tmpFolder, exist_ok=True)
|
|
26 |
def get_cloth_examples():
|
27 |
cloth_dir = os.path.join(data_dir, 'ClothImgs')
|
28 |
examples = []
|
29 |
-
|
|
|
30 |
cloth_id = f.split(".")[0]
|
31 |
cloth_path = os.path.join(cloth_dir, f)
|
32 |
examples.append([cloth_id, cloth_path])
|
|
|
26 |
def get_cloth_examples():
|
27 |
cloth_dir = os.path.join(data_dir, 'ClothImgs')
|
28 |
examples = []
|
29 |
+
files = sorted(os.listdir(cloth_dir))[::-1]
|
30 |
+
for f in files:
|
31 |
cloth_id = f.split(".")[0]
|
32 |
cloth_path = os.path.join(cloth_dir, f)
|
33 |
examples.append([cloth_id, cloth_path])
|