Merge pull request #158 from ishaangupta-YB/main

Fix SAM-2 API compatibility issue in preprocessing pipeline
This commit is contained in:
kelseyee
2025-11-14 16:01:55 +08:00
committed by GitHub
@@ -152,6 +152,10 @@ class SAM2VideoPredictor(_SAM2VideoPredictor):
# metadata for each tracking frame (e.g. which direction it's tracked)
inference_state["tracking_has_started"] = False
inference_state["frames_already_tracked"] = {}
# resolves KeyError: 'frames_tracked_per_obj' when using newer SAM-2 versions for running preprocessing in 'replacement mode'
inference_state["frames_tracked_per_obj"] = {}
# Warm up the visual backbone and cache the image feature on frame 0
self._get_image_feature(inference_state, frame_idx=0, batch_size=1)
return inference_state