hanszhu commited on
Commit
d1c88af
·
1 Parent(s): 61e2e2c

perf(medsam): reduce fallback candidate boxes to 8

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -727,7 +727,7 @@ def analyze_with_medsam(base_result, image):
727
  masks_for_overlay.append({"mask": seg_u8})
728
  else:
729
  # Fallback: derive candidate boxes and run MedSAM per box
730
- cand_bboxes = _find_topk_foreground_bboxes(pil_img, max_regions=12, min_area=200)
731
  for bbox in cand_bboxes:
732
  m = _medsam.segment_with_box(bbox)
733
  if m is None or not isinstance(m.get('mask'), np.ndarray):
 
727
  masks_for_overlay.append({"mask": seg_u8})
728
  else:
729
  # Fallback: derive candidate boxes and run MedSAM per box
730
+ cand_bboxes = _find_topk_foreground_bboxes(pil_img, max_regions=8, min_area=200)
731
  for bbox in cand_bboxes:
732
  m = _medsam.segment_with_box(bbox)
733
  if m is None or not isinstance(m.get('mask'), np.ndarray):