fbcode/deeplearning/projects/sam3_release/sam3/train/nms_helper.py
Differential Revision: D88935213 fbshipit-source-id: b0b9cd57858641f7ce398865caef5eed4ad5d8bb
This commit is contained in:
committed by
meta-codesync[bot]
parent
b26a5f330e
commit
962998a167
@@ -33,7 +33,7 @@ def convert_bbox_format(bbox: list) -> List[float]:
|
|||||||
# -------------------- Track-level NMS --------------------
|
# -------------------- Track-level NMS --------------------
|
||||||
def process_track_level_nms(video_groups: Dict, nms_threshold: float) -> Dict:
|
def process_track_level_nms(video_groups: Dict, nms_threshold: float) -> Dict:
|
||||||
"""Apply track-level NMS to all videos"""
|
"""Apply track-level NMS to all videos"""
|
||||||
for video_id, tracks in video_groups.items():
|
for tracks in video_groups.values():
|
||||||
track_detections = []
|
track_detections = []
|
||||||
|
|
||||||
# Process tracks
|
# Process tracks
|
||||||
@@ -76,7 +76,7 @@ def process_track_level_nms(video_groups: Dict, nms_threshold: float) -> Dict:
|
|||||||
# -------------------- Frame-level NMS --------------------
|
# -------------------- Frame-level NMS --------------------
|
||||||
def process_frame_level_nms(video_groups: Dict, nms_threshold: float) -> Dict:
|
def process_frame_level_nms(video_groups: Dict, nms_threshold: float) -> Dict:
|
||||||
"""Apply frame-level NMS to all videos"""
|
"""Apply frame-level NMS to all videos"""
|
||||||
for video_id, tracks in video_groups.items():
|
for tracks in video_groups.values():
|
||||||
if not tracks:
|
if not tracks:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user