yunyangx commited on
Commit
071c251
1 Parent(s): acf7fa0

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -412,16 +412,16 @@ with gr.Blocks(css=css, title="Efficient SAM") as demo:
412
  # Description
413
  gr.Markdown(description_p)
414
 
415
- cond_img_p.select(get_points_with_draw, [segm_img_p, cond_img_p], segm_img_p)
416
 
417
- cond_img_b.select(get_points_with_draw_, [segm_img_b, cond_img_b], segm_img_b)
418
 
419
  segment_btn_p.click(
420
- segment_with_points, inputs=[cond_img_p], outputs=segm_img_p
421
  )
422
 
423
  segment_btn_b.click(
424
- segment_with_boxs, inputs=[cond_img_b, segm_img_b], outputs=segm_img_b
425
  )
426
 
427
  def clear():
@@ -433,4 +433,5 @@ with gr.Blocks(css=css, title="Efficient SAM") as demo:
433
  clear_btn_p.click(clear, outputs=[cond_img_p, segm_img_p])
434
  clear_btn_b.click(clear, outputs=[cond_img_b, segm_img_b])
435
 
436
- demo.launch(enable_queue=True)
 
 
412
  # Description
413
  gr.Markdown(description_p)
414
 
415
+ cond_img_p.select(get_points_with_draw, [segm_img_p, cond_img_p], segm_img_p, queue=True)
416
 
417
+ cond_img_b.select(get_points_with_draw_, [segm_img_b, cond_img_b], segm_img_b, queue=True)
418
 
419
  segment_btn_p.click(
420
+ segment_with_points, inputs=[cond_img_p], outputs=segm_img_p, queue=True
421
  )
422
 
423
  segment_btn_b.click(
424
+ segment_with_boxs, inputs=[cond_img_b, segm_img_b], outputs=segm_img_b, queue=True
425
  )
426
 
427
  def clear():
 
433
  clear_btn_p.click(clear, outputs=[cond_img_p, segm_img_p])
434
  clear_btn_b.click(clear, outputs=[cond_img_b, segm_img_b])
435
 
436
+ demo.queue()
437
+ demo.launch()