Spaces:
Configuration error
Configuration error
parokshsaxena
commited on
Commit
Β·
31ccc70
1
Parent(s):
c58380c
using Image instead of image editor to ease up using api
Browse files
app.py
CHANGED
|
@@ -141,8 +141,8 @@ def start_tryon(dict,garm_img,garment_des, background_img, is_checked,is_checked
|
|
| 141 |
pipe.unet_encoder.to(device)
|
| 142 |
|
| 143 |
garm_img= garm_img.convert("RGB").resize((WIDTH,HEIGHT))
|
| 144 |
-
human_img_orig = dict["background"].convert("RGB")
|
| 145 |
-
|
| 146 |
if is_checked_crop:
|
| 147 |
width, height = human_img_orig.size
|
| 148 |
target_width = int(min(width, height * (3 / 4)))
|
|
@@ -287,7 +287,10 @@ with image_blocks as demo:
|
|
| 287 |
gr.Markdown("Upload an image of a person and an image of a garment β¨.")
|
| 288 |
with gr.Row():
|
| 289 |
with gr.Column():
|
| 290 |
-
|
|
|
|
|
|
|
|
|
|
| 291 |
with gr.Row():
|
| 292 |
is_checked = gr.Checkbox(label="Yes", info="Use auto-generated mask (Takes 5 seconds)",value=True)
|
| 293 |
with gr.Row():
|
|
|
|
| 141 |
pipe.unet_encoder.to(device)
|
| 142 |
|
| 143 |
garm_img= garm_img.convert("RGB").resize((WIDTH,HEIGHT))
|
| 144 |
+
# human_img_orig = dict["background"].convert("RGB")
|
| 145 |
+
human_img_orig = dict.convert("RGB")
|
| 146 |
if is_checked_crop:
|
| 147 |
width, height = human_img_orig.size
|
| 148 |
target_width = int(min(width, height * (3 / 4)))
|
|
|
|
| 287 |
gr.Markdown("Upload an image of a person and an image of a garment β¨.")
|
| 288 |
with gr.Row():
|
| 289 |
with gr.Column():
|
| 290 |
+
# changing from ImageEditor to Image to allow easy passing of data through API
|
| 291 |
+
# instead of passing {"dictionary": <>} ( which is failing ), we can directly pass the image
|
| 292 |
+
# imgs = gr.ImageEditor(sources='upload', type="pil", label='Human. Mask with pen or use auto-masking', interactive=True)
|
| 293 |
+
imgs = gr.Image(sources='upload', type='pil',label='Human. Mask with pen or use auto-masking')
|
| 294 |
with gr.Row():
|
| 295 |
is_checked = gr.Checkbox(label="Yes", info="Use auto-generated mask (Takes 5 seconds)",value=True)
|
| 296 |
with gr.Row():
|