phiyodr commited on
Commit
7b6b6f7
1 Parent(s): bd38b83

try fix title/desc

Browse files
Files changed (1) hide show
  1. app.py +22 -20
app.py CHANGED
@@ -162,8 +162,25 @@ def inference(img, alpha_factor):
162
  return im, all_images, background
163
 
164
 
165
- title = "dacl-challenge @ WACV2024"
166
- description = """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  <b>
168
  <p style="text-align:center">
169
  <a href='https://twitter.com/dacl_ai' target='_blank'>Twitter</a><a href='https://x.com/dacl_ai' target='_blank'>/X</a> |
@@ -200,23 +217,8 @@ description = """
200
 
201
  """
202
 
203
- article = "<p style='text-align: center'><a href='https://github.com/phiyodr/dacl10k-toolkit' target='_blank'>Github Repo</a></p>"
204
- examples=[
205
- ["assets/dacl10k_v2_validation_0026.jpg", "dacl10k_v2_validation_0026.jpg"],
206
- ["assets/dacl10k_v2_validation_0037.jpg", "dacl10k_v2_validation_0037.jpg"],
207
- ["assets/dacl10k_v2_validation_0053.jpg", "dacl10k_v2_validation_0053.jpg"],
208
- ["assets/dacl10k_v2_validation_0068.jpg", "dacl10k_v2_validation_0068.jpg"],
209
- ["assets/dacl10k_v2_validation_0153.jpg", "dacl10k_v2_validation_0153.jpg"],
210
- ["assets/dacl10k_v2_validation_0263.jpg", "dacl10k_v2_validation_0263.jpg"],
211
- ["assets/dacl10k_v2_validation_0336.jpg", "dacl10k_v2_validation_0336.jpg"],
212
- ["assets/dacl10k_v2_validation_0500.jpg", "dacl10k_v2_validation_0500.jpg"],
213
- ["assets/dacl10k_v2_validation_0549.jpg", "dacl10k_v2_validation_0549.jpg"],
214
- ["assets/dacl10k_v2_validation_0609.jpg", "dacl10k_v2_validation_0609.jpg"]
215
- ]
216
-
217
 
218
-
219
- with gr.Blocks() as app:
220
  with gr.Row():
221
  input_img = gr.inputs.Image(type="pil", label="Original Image")
222
  gr.Examples(examples=examples, inputs=[input_img])
@@ -230,10 +232,10 @@ with gr.Blocks() as app:
230
  all_masks = gr.Gallery(visible=False)
231
  background = gr.Image(visible=False)
232
 
233
- generate_mask_slider = gr.Button("Generate Masks")
234
  generate_mask_slider.click(inference, inputs=[input_img], outputs=[img, all_masks, background])
235
 
236
- submit_transparent_img = gr.Button("Generate Transparent Mask (with Alpha Factor)")
237
  submit_transparent_img.click(show_img, inputs=[all_masks, dropdown, background, slider], outputs=[transparent_img])
238
 
239
 
 
162
  return im, all_images, background
163
 
164
 
165
+
166
+ examples=[
167
+ ["assets/dacl10k_v2_validation_0026.jpg", "dacl10k_v2_validation_0026.jpg"],
168
+ ["assets/dacl10k_v2_validation_0037.jpg", "dacl10k_v2_validation_0037.jpg"],
169
+ ["assets/dacl10k_v2_validation_0053.jpg", "dacl10k_v2_validation_0053.jpg"],
170
+ ["assets/dacl10k_v2_validation_0068.jpg", "dacl10k_v2_validation_0068.jpg"],
171
+ ["assets/dacl10k_v2_validation_0153.jpg", "dacl10k_v2_validation_0153.jpg"],
172
+ ["assets/dacl10k_v2_validation_0263.jpg", "dacl10k_v2_validation_0263.jpg"],
173
+ ["assets/dacl10k_v2_validation_0336.jpg", "dacl10k_v2_validation_0336.jpg"],
174
+ ["assets/dacl10k_v2_validation_0500.jpg", "dacl10k_v2_validation_0500.jpg"],
175
+ ["assets/dacl10k_v2_validation_0549.jpg", "dacl10k_v2_validation_0549.jpg"],
176
+ ["assets/dacl10k_v2_validation_0609.jpg", "dacl10k_v2_validation_0609.jpg"]
177
+ ]
178
+
179
+
180
+
181
+ with gr.Blocks() as app:
182
+ title = "dacl-challenge @ WACV2024"
183
+ description = """
184
  <b>
185
  <p style="text-align:center">
186
  <a href='https://twitter.com/dacl_ai' target='_blank'>Twitter</a><a href='https://x.com/dacl_ai' target='_blank'>/X</a> |
 
217
 
218
  """
219
 
220
+ article = "<p style='text-align: center'><a href='https://github.com/phiyodr/dacl10k-toolkit' target='_blank'>Github Repo</a></p>"
 
 
 
 
 
 
 
 
 
 
 
 
 
221
 
 
 
222
  with gr.Row():
223
  input_img = gr.inputs.Image(type="pil", label="Original Image")
224
  gr.Examples(examples=examples, inputs=[input_img])
 
232
  all_masks = gr.Gallery(visible=False)
233
  background = gr.Image(visible=False)
234
 
235
+ generate_mask_slider = gr.Button("1) Generate Masks")
236
  generate_mask_slider.click(inference, inputs=[input_img], outputs=[img, all_masks, background])
237
 
238
+ submit_transparent_img = gr.Button("2) Generate Transparent Mask (with Alpha Factor)")
239
  submit_transparent_img.click(show_img, inputs=[all_masks, dropdown, background, slider], outputs=[transparent_img])
240
 
241