fbcode/deeplearning/projects/sam3_release/sam3/train/nms_helper.py

Differential Revision: D88935213

fbshipit-source-id: b0b9cd57858641f7ce398865caef5eed4ad5d8bb
This commit is contained in:
generatedunixname537391475639613
2025-12-21 01:40:42 -08:00
committed by meta-codesync[bot]
parent b26a5f330e
commit 962998a167

View File

@@ -33,7 +33,7 @@ def convert_bbox_format(bbox: list) -> List[float]:
# -------------------- Track-level NMS --------------------
def process_track_level_nms(video_groups: Dict, nms_threshold: float) -> Dict:
"""Apply track-level NMS to all videos"""
for video_id, tracks in video_groups.items():
for tracks in video_groups.values():
track_detections = []
# Process tracks
@@ -76,7 +76,7 @@ def process_track_level_nms(video_groups: Dict, nms_threshold: float) -> Dict:
# -------------------- Frame-level NMS --------------------
def process_frame_level_nms(video_groups: Dict, nms_threshold: float) -> Dict:
"""Apply frame-level NMS to all videos"""
for video_id, tracks in video_groups.items():
for tracks in video_groups.values():
if not tracks:
continue