NikhilJoson commited on
Commit
a5fa0df
ยท
verified ยท
1 Parent(s): d7eef16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -15
app.py CHANGED
@@ -257,22 +257,32 @@ with image_blocks as demo:
257
  example = gr.Examples(inputs=inp_img, examples_per_page=10, examples=human_ex_list)
258
 
259
  with gr.Column(scale=1):
260
- with gr.Row():
261
- topwear_image = gr.Image(label="Topwear", sources='upload', type="pil")
 
262
  with gr.Row():
263
  topwear_desc = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
264
- example = gr.Examples(inputs=[topwear_image,topwear_desc], examples_per_page=4,examples=topwear_ex_list)
265
- with gr.Row():
266
- bottomwear_image = gr.Image(label="Bottomwear", sources='upload', type="pil")
 
267
  with gr.Row():
268
  bottomwear_desc = gr.Textbox(placeholder="Description of garment ex) Cargo pants", show_label=False, elem_id="prompt")
269
  example = gr.Examples(inputs=[bottomwear_image,bottomwear_desc], examples_per_page=4, examples=bottomwear_ex_list)
270
- with gr.Row():
271
- dress_image = gr.Image(label="Dress", sources='upload', type="pil")
 
272
  with gr.Row():
273
  dress_desc = gr.Textbox(placeholder="Description of garment ex) Jumper suit", show_label=False, elem_id="prompt")
274
  example = gr.Examples(inputs=[dress_image,dress_desc], examples_per_page=4, examples=dress_ex_list)
275
 
 
 
 
 
 
 
 
276
  with gr.Row():
277
  with gr.Column():
278
  # image_out = gr.Image(label="Output", elem_id="output-img", height=400)
@@ -281,14 +291,6 @@ with image_blocks as demo:
281
  image_in = gr.Image(label="Midway Image", elem_id="midway-img",show_share_button=False)
282
  masked_img = gr.Image(label="Masked image output", elem_id="masked-img",show_share_button=False)
283
 
284
- with gr.Column():
285
- with gr.Accordion(label="Advanced Settings", open=False):
286
- with gr.Row():
287
- denoise_steps = gr.Number(label="Denoising Steps", minimum=20, maximum=40, value=30, step=1)
288
- seed = gr.Number(label="Seed", minimum=-1, maximum=2147483647, step=1, value=42)
289
- try_button = gr.Button(value="Try-on",variant='secondary')
290
-
291
-
292
  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],
293
  outputs=[image_in, image_out, masked_img], api_name='tryon')
294
 
 
257
  example = gr.Examples(inputs=inp_img, examples_per_page=10, examples=human_ex_list)
258
 
259
  with gr.Column(scale=1):
260
+ with gr.Row(elem_id="TopWear-container"):
261
+ with gr.Row():
262
+ topwear_image = gr.Image(label="Topwear", sources='upload', type="pil")
263
  with gr.Row():
264
  topwear_desc = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
265
+ example = gr.Examples(inputs=[topwear_image,topwear_desc], examples_per_page=4,examples=topwear_ex_list)
266
+ with gr.Row(elem_id="BottomWear-container"):
267
+ with gr.Row():
268
+ bottomwear_image = gr.Image(label="Bottomwear", sources='upload', type="pil")
269
  with gr.Row():
270
  bottomwear_desc = gr.Textbox(placeholder="Description of garment ex) Cargo pants", show_label=False, elem_id="prompt")
271
  example = gr.Examples(inputs=[bottomwear_image,bottomwear_desc], examples_per_page=4, examples=bottomwear_ex_list)
272
+ with gr.Row(elem_id="Dress-container"):
273
+ with gr.Row():
274
+ dress_image = gr.Image(label="Dress", sources='upload', type="pil")
275
  with gr.Row():
276
  dress_desc = gr.Textbox(placeholder="Description of garment ex) Jumper suit", show_label=False, elem_id="prompt")
277
  example = gr.Examples(inputs=[dress_image,dress_desc], examples_per_page=4, examples=dress_ex_list)
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=26, 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='primary')
285
+
286
  with gr.Row():
287
  with gr.Column():
288
  # image_out = gr.Image(label="Output", elem_id="output-img", height=400)
 
291
  image_in = gr.Image(label="Midway Image", elem_id="midway-img",show_share_button=False)
292
  masked_img = gr.Image(label="Masked image output", elem_id="masked-img",show_share_button=False)
293
 
 
 
 
 
 
 
 
 
294
  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],
295
  outputs=[image_in, image_out, masked_img], api_name='tryon')
296