From 194b4927b0161b5b1af188ce03f63e16ac46ca12 Mon Sep 17 00:00:00 2001 From: Vincent Demoulin Date: Tue, 11 Aug 2026 17:05:56 +0200 Subject: [PATCH] [VideoMatting] bugfix in merged tracking extraction --- segmentationRDS/bboxUtils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/segmentationRDS/bboxUtils.py b/segmentationRDS/bboxUtils.py index a3daf55..6f3d6f8 100644 --- a/segmentationRDS/bboxUtils.py +++ b/segmentationRDS/bboxUtils.py @@ -234,11 +234,15 @@ def extract_tracking( if merged: all_frames = sorted(set(merged.keys()),key=int) for frame_idx in all_frames: - raw_boxes[int(frame_idx)] = merged.get(frame_idx, {}).get(obj_id) + box = merged.get(frame_idx, {}).get(obj_id) + if box: + raw_boxes[int(frame_idx)] = box else: all_frames = sorted(set(forward.keys()),key=int) for frame_idx in all_frames: - raw_boxes[int(frame_idx)] = forward.get(frame_idx, {}).get(obj_id) + box = forward.get(frame_idx, {}).get(obj_id) + if box: + raw_boxes[int(frame_idx)] = box # --- compute target size --- target_size_w, target_size_h = get_target_size(raw_boxes, par, roundCrop, squareBox, exp_factor)