aljun5 commited on
Commit
06afcfb
·
verified ·
1 Parent(s): 8892722

revert to the previous commit

Browse files
Files changed (1) hide show
  1. app.py +27 -94
app.py CHANGED
@@ -23,16 +23,16 @@ MODEL_MAP = {
23
  # Sample clothing items from your clothes folder
24
  SAMPLE_CLOTHES = {
25
  "top": [
26
- "clothes/shirt.jpg",
27
- "clothes/cardigan.jpg",
28
- "clothes/jacket.jpg",
29
- "clothes/dress.jpg"
30
  ],
31
  "bottom": [
32
- "clothes/pants.jpg",
33
- "clothes/jeans.jpg",
34
- "clothes/skirt.jpg",
35
- "clothes/shorts.jpg"
36
  ]
37
  }
38
 
@@ -145,38 +145,15 @@ with gr.Blocks(css = ".output-image, .input-image, .image-preview {height: 400px
145
  """)
146
  with gr.Row():
147
  with gr.Column():
148
- # Model selection buttons with preview images
149
  gr.HTML("<h3>Select AI Model:</h3>")
150
  with gr.Row():
151
- with gr.Column():
152
- model_preview1 = gr.Image(value=MODEL_MAP["AI Model female_model"],
153
- label="Female Model",
154
- height=150, width=100,
155
- interactive=False, show_label=True)
156
- model_btn1 = gr.Button("Select Female Model", variant="secondary")
157
-
158
- with gr.Column():
159
- model_preview2 = gr.Image(value=MODEL_MAP["AI Model female_model1"],
160
- label="Female Model 1",
161
- height=150, width=100,
162
- interactive=False, show_label=True)
163
- model_btn2 = gr.Button("Select Female Model 1", variant="secondary")
164
-
165
- with gr.Column():
166
- model_preview3 = gr.Image(value=MODEL_MAP["AI Model male_model"],
167
- label="Male Model",
168
- height=150, width=100,
169
- interactive=False, show_label=True)
170
- model_btn3 = gr.Button("Select Male Model", variant="secondary")
171
-
172
- with gr.Column():
173
- model_preview4 = gr.Image(value=MODEL_MAP["AI Model male_model2"],
174
- label="Male Model 2",
175
- height=150, width=100,
176
- interactive=False, show_label=True)
177
- model_btn4 = gr.Button("Select Male Model 2", variant="secondary")
178
 
179
- init_image = gr.Image(sources='clipboard', type="filepath", label="Selected Model", value=model)
180
 
181
  with gr.Column():
182
  gr.HTML(
@@ -189,68 +166,24 @@ with gr.Blocks(css = ".output-image, .input-image, .image-preview {height: 400px
189
  </div>
190
  """)
191
 
192
- # Sample clothing buttons section with preview images
193
  gr.HTML("<h3>Quick Select Sample Clothes:</h3>")
194
 
195
- gr.HTML("<h4>Top Garments:</h4>")
196
  with gr.Row():
197
- with gr.Column():
198
- top_preview1 = gr.Image(value=SAMPLE_CLOTHES["top"][0],
199
- label="Shirt",
200
- height=150, width=100,
201
- interactive=False, show_label=True)
202
- top_btn1 = gr.Button("Select Shirt", variant="secondary")
203
-
204
- with gr.Column():
205
- top_preview2 = gr.Image(value=SAMPLE_CLOTHES["top"][1],
206
- label="Cardigan",
207
- height=150, width=100,
208
- interactive=False, show_label=True)
209
- top_btn2 = gr.Button("Select Cardigan", variant="secondary")
210
-
211
- with gr.Column():
212
- top_preview3 = gr.Image(value=SAMPLE_CLOTHES["top"][2],
213
- label="Jacket",
214
- height=150, width=100,
215
- interactive=False, show_label=True)
216
- top_btn3 = gr.Button("Select Jacket", variant="secondary")
217
-
218
- with gr.Column():
219
- top_preview4 = gr.Image(value=SAMPLE_CLOTHES["top"][3],
220
- label="Dress",
221
- height=150, width=100,
222
- interactive=False, show_label=True)
223
- top_btn4 = gr.Button("Select Dress", variant="secondary")
224
 
225
- gr.HTML("<h4>Bottom Garments:</h4>")
226
  with gr.Row():
227
- with gr.Column():
228
- bottom_preview1 = gr.Image(value=SAMPLE_CLOTHES["bottom"][0],
229
- label="Pants",
230
- height=150, width=100,
231
- interactive=False, show_label=True)
232
- bottom_btn1 = gr.Button("Select Pants", variant="secondary")
233
-
234
- with gr.Column():
235
- bottom_preview2 = gr.Image(value=SAMPLE_CLOTHES["bottom"][1],
236
- label="Jeans",
237
- height=150, width=100,
238
- interactive=False, show_label=True)
239
- bottom_btn2 = gr.Button("Select Jeans", variant="secondary")
240
-
241
- with gr.Column():
242
- bottom_preview3 = gr.Image(value=SAMPLE_CLOTHES["bottom"][2],
243
- label="Skirt",
244
- height=150, width=100,
245
- interactive=False, show_label=True)
246
- bottom_btn3 = gr.Button("Select Skirt", variant="secondary")
247
-
248
- with gr.Column():
249
- bottom_preview4 = gr.Image(value=SAMPLE_CLOTHES["bottom"][3],
250
- label="Shorts",
251
- height=150, width=100,
252
- interactive=False, show_label=True)
253
- bottom_btn4 = gr.Button("Select Shorts", variant="secondary")
254
 
255
  with gr.Row():
256
  garment_top = gr.Image(sources='upload', type="numpy", label="top garment")
 
23
  # Sample clothing items from your clothes folder
24
  SAMPLE_CLOTHES = {
25
  "top": [
26
+ "clothes/shirt1.jpg",
27
+ "clothes/shirt2.jpg",
28
+ "clothes/dress1.jpg",
29
+ "clothes/jacket1.jpg"
30
  ],
31
  "bottom": [
32
+ "clothes/pants1.jpg",
33
+ "clothes/skirt1.jpg",
34
+ "clothes/jeans1.jpg",
35
+ "clothes/shorts1.jpg"
36
  ]
37
  }
38
 
 
145
  """)
146
  with gr.Row():
147
  with gr.Column():
148
+ # Model selection buttons
149
  gr.HTML("<h3>Select AI Model:</h3>")
150
  with gr.Row():
151
+ model_btn1 = gr.Button("Female Model", variant="secondary")
152
+ model_btn2 = gr.Button("Female Model 1", variant="secondary")
153
+ model_btn3 = gr.Button("Male Model", variant="secondary")
154
+ model_btn4 = gr.Button("Male Model 2", variant="secondary")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
+ init_image = gr.Image(sources='clipboard', type="filepath", label="model", value=model)
157
 
158
  with gr.Column():
159
  gr.HTML(
 
166
  </div>
167
  """)
168
 
169
+ # Sample clothing buttons section
170
  gr.HTML("<h3>Quick Select Sample Clothes:</h3>")
171
 
 
172
  with gr.Row():
173
+ gr.HTML("<h4>Top Garments:</h4>")
174
+ with gr.Row():
175
+ top_btn1 = gr.Button("Shirt 1", variant="secondary")
176
+ top_btn2 = gr.Button("Shirt 2", variant="secondary")
177
+ top_btn3 = gr.Button("Dress", variant="secondary")
178
+ top_btn4 = gr.Button("Jacket", variant="secondary")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
 
 
180
  with gr.Row():
181
+ gr.HTML("<h4>Bottom Garments:</h4>")
182
+ with gr.Row():
183
+ bottom_btn1 = gr.Button("Pants", variant="secondary")
184
+ bottom_btn2 = gr.Button("Skirt", variant="secondary")
185
+ bottom_btn3 = gr.Button("Jeans", variant="secondary")
186
+ bottom_btn4 = gr.Button("Shorts", variant="secondary")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
 
188
  with gr.Row():
189
  garment_top = gr.Image(sources='upload', type="numpy", label="top garment")