Spaces:
Build error
Build error
jocoandonob commited on
Commit ·
ba01344
1
Parent(s): 4d2e566
Revert "fv"
Browse filesThis reverts commit 4d2e566d1f73136d6f07781c1113d65c858968ff.
app.py
CHANGED
|
@@ -132,47 +132,32 @@ def process_image(human_img_path, garm_img_path):
|
|
| 132 |
return generated_image
|
| 133 |
|
| 134 |
|
| 135 |
-
|
| 136 |
-
with
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
with gr.TabItem("Help"):
|
| 166 |
-
gr.HTML("""
|
| 167 |
-
<div style="text-align: center; padding: 20px;">
|
| 168 |
-
<h1>Thank You!</h1>
|
| 169 |
-
<p style="font-size: 18px; margin: 20px 0;">
|
| 170 |
-
Thank you for using our Virtual Try-On application. We appreciate your support and hope you enjoy trying on different outfits virtually!
|
| 171 |
-
</p>
|
| 172 |
-
<p style="font-size: 16px; margin: 20px 0;">
|
| 173 |
-
If you have any questions or need assistance, please don't hesitate to reach out to our support team.
|
| 174 |
-
</p>
|
| 175 |
-
</div>
|
| 176 |
-
""")
|
| 177 |
-
|
| 178 |
-
demo.launch(show_error=True)
|
|
|
|
| 132 |
return generated_image
|
| 133 |
|
| 134 |
|
| 135 |
+
image_blocks = gr.Blocks().queue()
|
| 136 |
+
with image_blocks as demo:
|
| 137 |
+
gr.HTML("<center><h1>Virtual Try-On</h1></center>")
|
| 138 |
+
gr.HTML("<center><p>Upload an image of a person and an image of a garment ✨</p></center>")
|
| 139 |
+
with gr.Row():
|
| 140 |
+
with gr.Column():
|
| 141 |
+
human_img = gr.Image(type="filepath", label='Human', interactive=True)
|
| 142 |
+
example = gr.Examples(
|
| 143 |
+
inputs=human_img,
|
| 144 |
+
examples_per_page=10,
|
| 145 |
+
examples=human_list_path
|
| 146 |
+
)
|
| 147 |
+
|
| 148 |
+
with gr.Column():
|
| 149 |
+
garm_img = gr.Image(label="Garment", type="filepath", interactive=True)
|
| 150 |
+
example = gr.Examples(
|
| 151 |
+
inputs=garm_img,
|
| 152 |
+
examples_per_page=8,
|
| 153 |
+
examples=garm_list_path)
|
| 154 |
+
with gr.Column():
|
| 155 |
+
image_out = gr.Image(label="Processed image", type="pil")
|
| 156 |
+
|
| 157 |
+
with gr.Row():
|
| 158 |
+
try_button = gr.Button(value="Try-on", variant='primary')
|
| 159 |
+
|
| 160 |
+
# Linking the button to the processing function
|
| 161 |
+
try_button.click(fn=process_image, inputs=[human_img, garm_img], outputs=image_out)
|
| 162 |
+
|
| 163 |
+
image_blocks.launch(show_error=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|