Keshabwi66 commited on
Commit
5ed4c76
·
verified ·
1 Parent(s): 65e7974

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -17
app.py CHANGED
@@ -193,35 +193,33 @@ def start_tryon(person_img, pose_img, mask_img, cloth_img, garment_des, denoise_
193
 
194
  return images
195
 
 
196
  # Gradio interface for the virtual try-on model
197
  image_blocks = gr.Blocks().queue()
198
 
199
  with image_blocks as demo:
200
- gr.Markdown("## SmartLuga ")
 
 
201
  with gr.Row():
202
  with gr.Column():
203
- imgs = gr.ImageEditor(sources='upload', type="pil", label='Human Image', interactive=True)
204
- with gr.Row():
205
- is_checked_crop = gr.Checkbox(label="Use auto-crop & resizing", value=False)
206
 
207
  with gr.Column():
208
- garm_img = gr.Image(label="Garment", sources='upload', type="pil")
209
- with gr.Row(elem_id="prompt-container"):
210
- prompt = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", show_label=False, elem_id="prompt")
211
 
212
  with gr.Column():
213
- masked_img = gr.Image(label="Masked image output", elem_id="masked-img", show_share_button=False)
 
214
 
215
  with gr.Column():
216
- image_out = gr.Image(label="Output", elem_id="output-img", show_share_button=False)
217
-
218
- with gr.Column():
219
- try_button = gr.Button(value="Try-on")
220
- with gr.Accordion(label="Advanced Settings", open=False):
221
- with gr.Row():
222
- denoise_steps = gr.Number(label="Denoising Steps", minimum=20, maximum=40, value=30, step=1)
223
- seed = gr.Number(label="Seed", minimum=-1, maximum=2147483647, step=1, value=42)
224
 
225
- try_button.click(fn=start_tryon, inputs=[imgs, garm_img, prompt, denoise_steps, seed], outputs=[image_out, masked_img], api_name='tryon')
 
226
 
227
  image_blocks.launch()
 
193
 
194
  return images
195
 
196
+
197
  # Gradio interface for the virtual try-on model
198
  image_blocks = gr.Blocks().queue()
199
 
200
  with image_blocks as demo:
201
+ gr.Markdown("## SmartLuga")
202
+ gr.Markdown("Virtual Try-on with your image and garment image. Check out the [source codes](https://github.com/yisol/IDM-VTON) and the [model](https://huggingface.co/yisol/IDM-VTON)")
203
+
204
  with gr.Row():
205
  with gr.Column():
206
+ person_img = gr.Image(label='Person Image', sources='upload', type="pil")
207
+ pose_img = gr.Image(label='Pose Image', sources='upload', type="pil")
208
+ mask_img = gr.Image(label='Mask Image', sources='upload', type="pil")
209
 
210
  with gr.Column():
211
+ cloth_img = gr.Image(label='Garment Image', sources='upload', type="pil")
212
+ garment_des = gr.Textbox(placeholder="Description of garment ex) Short Sleeve Round Neck T-shirts", label="Garment Description")
 
213
 
214
  with gr.Column():
215
+ denoise_steps = gr.Number(label="Denoising Steps", minimum=20, maximum=40, value=30, step=1)
216
+ seed = gr.Number(label="Seed", minimum=-1, maximum=2147483647, step=1, value=42)
217
 
218
  with gr.Column():
219
+ masked_img = gr.Image(label="Masked Image Output", elem_id="masked-img", show_share_button=False)
220
+ image_out = gr.Image(label="Output Image", elem_id="output-img", show_share_button=False)
 
 
 
 
 
 
221
 
222
+ try_button = gr.Button(value="Try-on")
223
+ try_button.click(fn=start_tryon, inputs=[person_img, pose_img, mask_img, cloth_img, garment_des, denoise_steps, seed], outputs=[image_out, masked_img], api_name='tryon')
224
 
225
  image_blocks.launch()