Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
204 |
-
|
205 |
-
|
206 |
|
207 |
with gr.Column():
|
208 |
-
|
209 |
-
|
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 |
-
|
|
|
214 |
|
215 |
with gr.Column():
|
216 |
-
|
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
|
|
|
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()
|