Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix vid dataloader for frame limit #709

Merged
merged 1 commit into from
Oct 13, 2024
Merged
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
7 changes: 5 additions & 2 deletions data/self_supervised_vid_mask_online_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, opt, phase, name=""):
)
# Initialize a dictionary to count how many available paths belong to each directory
self.frames_counts = {
vid_serie: -self.num_frames * self.frame_step
vid_serie: (-self.num_frames + 1) * self.frame_step
for vid_serie in self.vid_series_paths
}
# Loop through self.A_img_paths and count the occurrences of each directory
Expand Down Expand Up @@ -112,7 +112,10 @@ def get_img(
): # all params are unused

if len(self.frames_counts) == 1: # single video mario
index_A = random.randint(0, self.range_A - 1)
if self.range_A == 0:
index_A = 0
else:
index_A = random.randint(0, self.range_A - 1)
else: # video series
range_A = self.cumulative_sums[
-1
Expand Down
Loading