Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/datasets/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 4 additions & 9 deletions src/datasets/video_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down