LiuZichen commited on
Commit
0f883aa
·
verified ·
1 Parent(s): 644a908

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -248,7 +248,7 @@ with gr.Blocks() as app:
248
  inputs=[sam_input_img, sam_pos_coords, sam_neg_coords, sam_bboxes],
249
  outputs=[sam_output_img, sam_output_bbox],
250
  api_name="segment",
251
- concurrency_limit=10
252
  )
253
 
254
  if __name__ == "__main__":
@@ -257,9 +257,9 @@ if __name__ == "__main__":
257
 
258
  # Initialize SAM Pool
259
  # Adjust max_workers based on GPU memory (e.g., 2-4 workers for SAM-B)
260
- NUM_SAM_WORKERS = 10
261
  print(f"Starting {NUM_SAM_WORKERS} SAM worker processes...")
262
  sam_pool = ProcessPoolExecutor(max_workers=NUM_SAM_WORKERS, initializer=init_worker_sam)
263
 
264
  # Launch Gradio
265
- app.queue(max_size=40).launch(max_threads=10)
 
248
  inputs=[sam_input_img, sam_pos_coords, sam_neg_coords, sam_bboxes],
249
  outputs=[sam_output_img, sam_output_bbox],
250
  api_name="segment",
251
+ concurrency_limit=5
252
  )
253
 
254
  if __name__ == "__main__":
 
257
 
258
  # Initialize SAM Pool
259
  # Adjust max_workers based on GPU memory (e.g., 2-4 workers for SAM-B)
260
+ NUM_SAM_WORKERS = 5
261
  print(f"Starting {NUM_SAM_WORKERS} SAM worker processes...")
262
  sam_pool = ProcessPoolExecutor(max_workers=NUM_SAM_WORKERS, initializer=init_worker_sam)
263
 
264
  # Launch Gradio
265
+ app.queue(max_size=40).launch(max_threads=5)