jocoandonob
commited on
Commit
·
4d2e566
1
Parent(s):
0f7f5eb
fv
Browse files
app.py
CHANGED
@@ -132,32 +132,47 @@ def process_image(human_img_path, garm_img_path):
|
|
132 |
return generated_image
|
133 |
|
134 |
|
135 |
-
|
136 |
-
with
|
137 |
-
gr.
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
return generated_image
|
133 |
|
134 |
|
135 |
+
# Create the main interface
|
136 |
+
with gr.Blocks() as demo:
|
137 |
+
with gr.Tabs():
|
138 |
+
with gr.TabItem("Virtual Try-On"):
|
139 |
+
gr.HTML("<center><h1>Virtual Try-On</h1></center>")
|
140 |
+
gr.HTML("<center><p>Upload an image of a person and an image of a garment ✨</p></center>")
|
141 |
+
with gr.Row():
|
142 |
+
with gr.Column():
|
143 |
+
human_img = gr.Image(type="filepath", label='Human', interactive=True)
|
144 |
+
example = gr.Examples(
|
145 |
+
inputs=human_img,
|
146 |
+
examples_per_page=10,
|
147 |
+
examples=human_list_path
|
148 |
+
)
|
149 |
+
|
150 |
+
with gr.Column():
|
151 |
+
garm_img = gr.Image(label="Garment", type="filepath", interactive=True)
|
152 |
+
example = gr.Examples(
|
153 |
+
inputs=garm_img,
|
154 |
+
examples_per_page=8,
|
155 |
+
examples=garm_list_path)
|
156 |
+
with gr.Column():
|
157 |
+
image_out = gr.Image(label="Processed image", type="pil")
|
158 |
+
|
159 |
+
with gr.Row():
|
160 |
+
try_button = gr.Button(value="Try-on", variant='primary')
|
161 |
+
|
162 |
+
# Linking the button to the processing function
|
163 |
+
try_button.click(fn=process_image, inputs=[human_img, garm_img], outputs=image_out)
|
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)
|