Spaces:
Sleeping
Sleeping
perf(medsam): reduce fallback candidate boxes to 8
Browse files
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=
|
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):
|