From 331b779a904356a2518d1743b751f85f72ca691f Mon Sep 17 00:00:00 2001 From: Laszlo Turanyi Date: Wed, 11 Mar 2026 13:17:33 +0000 Subject: [PATCH 1/2] Fix: forward drop_last to make_videodataset --- src/datasets/data_manager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/datasets/data_manager.py b/src/datasets/data_manager.py index e3548639..fef4f5ee 100644 --- a/src/datasets/data_manager.py +++ b/src/datasets/data_manager.py @@ -81,6 +81,7 @@ def init_data( num_workers=num_workers, pin_mem=pin_mem, persistent_workers=persistent_workers, + drop_last=drop_last, world_size=world_size, rank=rank, deterministic=deterministic, From d3e9d74e842a581ffdcd57c756c078ca46197906 Mon Sep 17 00:00:00 2001 From: Laszlo Turanyi Date: Thu, 12 Mar 2026 16:48:27 +0000 Subject: [PATCH 2/2] Fix overlap sampling to use uniform arange instead of linspace Replaced np.linspace + padding with np.arange(fpc) * fstp in the allow_clip_overlap branch. linspace over (clip_len-1) frames produced non-integer steps (e.g. 5.64 for fstp=5) that alternated between 5 and 6 after int casting. arange gives exactly uniform steps of fstp; np.clip handles videos shorter than clip_len by repeating the last frame. Co-Authored-By: Claude Sonnet 4.6 --- src/datasets/video_dataset.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/datasets/video_dataset.py b/src/datasets/video_dataset.py index b0c47f66..cf3b24dc 100644 --- a/src/datasets/video_dataset.py +++ b/src/datasets/video_dataset.py @@ -348,15 +348,10 @@ def loadvideo_decord(self, sample, fpc): # If partition overlap is allowed and partition_len < clip_len # then start_indx of segment i+1 will lie within segment i else: - sample_len = min(clip_len, len(vr)) - 1 - indices = np.linspace(0, sample_len, num=sample_len // fstp) - indices = np.concatenate( - ( - indices, - np.ones(fpc - sample_len // fstp) * sample_len, - ) - ) - indices = np.clip(indices, 0, sample_len - 1).astype(np.int64) + max_idx = min(clip_len, len(vr)) - 1 + indices = np.clip( + np.arange(fpc) * fstp, 0, max_idx + ).astype(np.int64) # -- clip_step = 0 if len(vr) > clip_len: