mirror of
https://github.com/Wan-Video/Wan2.2.git
synced 2026-09-01 15:08:07 +08:00
fixed sam-2 API compatibility in video_predictor.py by Initializing missing frames_tracked_per_obj dictionary in inference state
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user