Canyu commited on
Commit
97844a5
·
verified ·
1 Parent(s): 101dbdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -24
app.py CHANGED
@@ -38,10 +38,8 @@ def postprocess(output, prompt):
38
  right = (i + 1) * slice_width if i < n - 1 else w
39
  cropped_img = image.crop((left, 0, right, h))
40
 
41
- # 生成 caption
42
  caption = prompt[i]
43
 
44
- # 存入列表
45
  result.append((cropped_img, caption))
46
  return result
47
 
@@ -256,9 +254,9 @@ def run_demo_server():
256
  with gr.Row():
257
  gr.Markdown('The results of semantic segmentation may be unstable because:')
258
  with gr.Row():
259
- gr.Markdown('1. We only trained on COCO, whose quality and quantity are insufficient to meet the requirements.')
260
  with gr.Row():
261
- gr.Markdown('2. Semantic segmentation is more complex than other tasks, as it requires accurately learning the relationship between semantics and objects.')
262
  with gr.Row():
263
  gr.Markdown('However, we are still able to produce some high-quality semantic segmentation results, strongly demonstrating the potential of our approach.')
264
  with gr.Row():
@@ -280,22 +278,10 @@ def run_demo_server():
280
  undo_button = gr.Button('Undo point')
281
  matting_image_reset_btn = gr.Button(value="Reset")
282
 
283
- # with gr.Row():
284
- # img_clear_button = gr.Button("Clear Cache")
285
 
286
  with gr.Column():
287
- # matting_image_output = gr.Image(label='Output')
288
- # matting_image_output = gr.Image(label='Results')
289
  matting_image_output = gr.Gallery(label="Results")
290
 
291
- # label="Matting Output",
292
- # type="filepath",
293
- # show_download_button=True,
294
- # show_share_button=True,
295
- # interactive=False,
296
- # elem_classes="slider",
297
- # position=0.25,
298
- # )
299
 
300
 
301
 
@@ -308,7 +294,6 @@ def run_demo_server():
308
  preprocess=False,
309
  queue=False,
310
  ).success(
311
- # fn=process_pipe_matting,
312
  fn=inf,
313
  inputs=[original_image, checkbox_group, selected_points, semantic_input],
314
  outputs=[matting_image_output],
@@ -376,13 +361,6 @@ def run_demo_server():
376
  cache_examples=False,
377
  )
378
 
379
- # examples.dataset.click(
380
- # fn=dummy
381
- # ).success(
382
- # fn=set_point, # Now run the actual function after inputs are populated
383
- # inputs=[input_image, checkbox_group, selected_points_tmp, semantic_input],
384
- # outputs=[input_image, selected_points]
385
- # )
386
 
387
  demo.queue(
388
  api_open=False,
 
38
  right = (i + 1) * slice_width if i < n - 1 else w
39
  cropped_img = image.crop((left, 0, right, h))
40
 
 
41
  caption = prompt[i]
42
 
 
43
  result.append((cropped_img, caption))
44
  return result
45
 
 
254
  with gr.Row():
255
  gr.Markdown('The results of semantic segmentation may be unstable because:')
256
  with gr.Row():
257
+ gr.Markdown('- We only trained on COCO, whose quality and quantity are insufficient to meet the requirements.')
258
  with gr.Row():
259
+ gr.Markdown('- Semantic segmentation is more complex than other tasks, as it requires accurately learning the relationship between semantics and objects.')
260
  with gr.Row():
261
  gr.Markdown('However, we are still able to produce some high-quality semantic segmentation results, strongly demonstrating the potential of our approach.')
262
  with gr.Row():
 
278
  undo_button = gr.Button('Undo point')
279
  matting_image_reset_btn = gr.Button(value="Reset")
280
 
 
 
281
 
282
  with gr.Column():
 
 
283
  matting_image_output = gr.Gallery(label="Results")
284
 
 
 
 
 
 
 
 
 
285
 
286
 
287
 
 
294
  preprocess=False,
295
  queue=False,
296
  ).success(
 
297
  fn=inf,
298
  inputs=[original_image, checkbox_group, selected_points, semantic_input],
299
  outputs=[matting_image_output],
 
361
  cache_examples=False,
362
  )
363
 
 
 
 
 
 
 
 
364
 
365
  demo.queue(
366
  api_open=False,