Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -237,50 +237,51 @@ image_blocks = gr.Blocks(theme="Nymbo/Alyx_Theme").queue()
|
|
237 |
with image_blocks as demo:
|
238 |
gr.HTML("<center><h1>Virtual Try-On</h1></center>")
|
239 |
gr.HTML("<center><p>Upload an image of a person and images of the clothes✨</p></center>")
|
240 |
-
with gr.Row():
|
241 |
-
with gr.Column():
|
242 |
-
inp_img = gr.ImageEditor(sources='upload', type="pil", label='Human. Mask with pen or use auto-masking', interactive=True)
|
243 |
-
with gr.Row():
|
244 |
-
is_checked = gr.Checkbox(label="Yes", info="Use auto-generated mask (Takes 5 seconds)",value=True)
|
245 |
-
with gr.Row():
|
246 |
-
is_checked_crop = gr.Checkbox(label="Yes", info="Use auto-crop & resizing",value=False)
|
247 |
-
example = gr.Examples(inputs=inp_img, examples_per_page=10, examples=human_ex_list)
|
248 |
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
topwear_image = gr.Image(label="Topwear", sources='upload', type="pil")
|
251 |
with gr.Row(elem_id="topwear-prompt-container"):
|
252 |
with gr.Row():
|
253 |
topwear_desc = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
|
254 |
example = gr.Examples(inputs=topwear_image, examples_per_page=8,examples=topwear_list_path)
|
255 |
-
with gr.
|
256 |
bottomwear_image = gr.Image(label="Bottomwear", sources='upload', type="pil")
|
257 |
with gr.Row(elem_id="bottomwear-prompt-container"):
|
258 |
with gr.Row():
|
259 |
bottomwear_desc = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
|
260 |
example = gr.Examples(inputs=bottomwear_image, examples_per_page=8, examples=bottomwear_list_path)
|
261 |
-
with gr.
|
262 |
dress_image = gr.Image(label="Dress", sources='upload', type="pil")
|
263 |
with gr.Row(elem_id="dress-prompt-container"):
|
264 |
with gr.Row():
|
265 |
dress_desc = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
|
266 |
example = gr.Examples(inputs=dress_image, examples_per_page=8, examples=dress_list_path)
|
267 |
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
with gr.Column():
|
279 |
-
try_button = gr.Button(value="Try-on",variant='primary')
|
280 |
with gr.Accordion(label="Advanced Settings", open=False):
|
281 |
with gr.Row():
|
282 |
denoise_steps = gr.Number(label="Denoising Steps", minimum=20, maximum=40, value=30, step=1)
|
283 |
seed = gr.Number(label="Seed", minimum=-1, maximum=2147483647, step=1, value=42)
|
|
|
284 |
|
285 |
|
286 |
try_button.click(fn=main_, inputs=[inp_img,topwear_image,topwear_desc,bottomwear_image,bottomwear_desc,dress_image,dress_desc,is_checked,is_checked_crop,denoise_steps,seed],
|
|
|
237 |
with image_blocks as demo:
|
238 |
gr.HTML("<center><h1>Virtual Try-On</h1></center>")
|
239 |
gr.HTML("<center><p>Upload an image of a person and images of the clothes✨</p></center>")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
+
with gr.Column():
|
242 |
+
inp_img = gr.ImageEditor(sources='upload', type="pil", label='Human. Mask with pen or use auto-masking', interactive=True)
|
243 |
+
with gr.Row():
|
244 |
+
is_checked = gr.Checkbox(label="Yes", info="Use auto-generated mask (Takes 5 seconds)",value=True)
|
245 |
+
with gr.Row():
|
246 |
+
is_checked_crop = gr.Checkbox(label="Yes", info="Use auto-crop & resizing",value=False)
|
247 |
+
example = gr.Examples(inputs=inp_img, examples_per_page=10, examples=human_ex_list)
|
248 |
+
|
249 |
+
with gr.Column():
|
250 |
+
with gr.Row():
|
251 |
topwear_image = gr.Image(label="Topwear", sources='upload', type="pil")
|
252 |
with gr.Row(elem_id="topwear-prompt-container"):
|
253 |
with gr.Row():
|
254 |
topwear_desc = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
|
255 |
example = gr.Examples(inputs=topwear_image, examples_per_page=8,examples=topwear_list_path)
|
256 |
+
with gr.Row():
|
257 |
bottomwear_image = gr.Image(label="Bottomwear", sources='upload', type="pil")
|
258 |
with gr.Row(elem_id="bottomwear-prompt-container"):
|
259 |
with gr.Row():
|
260 |
bottomwear_desc = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
|
261 |
example = gr.Examples(inputs=bottomwear_image, examples_per_page=8, examples=bottomwear_list_path)
|
262 |
+
with gr.Row():
|
263 |
dress_image = gr.Image(label="Dress", sources='upload', type="pil")
|
264 |
with gr.Row(elem_id="dress-prompt-container"):
|
265 |
with gr.Row():
|
266 |
dress_desc = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
|
267 |
example = gr.Examples(inputs=dress_image, examples_per_page=8, examples=dress_list_path)
|
268 |
|
269 |
+
with gr.Column():
|
270 |
+
# image_out = gr.Image(label="Output", elem_id="output-img", height=400)
|
271 |
+
image_out = gr.Image(label="Output", elem_id="output-img",show_share_button=False)
|
272 |
+
with gr.Accordion("Debug Info", open=False):
|
273 |
+
image_in = gr.Image(label="Midway Image", elem_id="midway-img",show_share_button=False)
|
274 |
+
masked_img = gr.Image(label="Masked image output", elem_id="masked-img",show_share_button=False)
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
with gr.Column():
|
|
|
280 |
with gr.Accordion(label="Advanced Settings", open=False):
|
281 |
with gr.Row():
|
282 |
denoise_steps = gr.Number(label="Denoising Steps", minimum=20, maximum=40, value=30, step=1)
|
283 |
seed = gr.Number(label="Seed", minimum=-1, maximum=2147483647, step=1, value=42)
|
284 |
+
try_button = gr.Button(value="Try-on",variant='secondary')
|
285 |
|
286 |
|
287 |
try_button.click(fn=main_, inputs=[inp_img,topwear_image,topwear_desc,bottomwear_image,bottomwear_desc,dress_image,dress_desc,is_checked,is_checked_crop,denoise_steps,seed],
|