From c21088e23867d45511bba8a92aa3803fc0e05ac6 Mon Sep 17 00:00:00 2001 From: James Betker Date: Tue, 3 Nov 2020 14:32:06 -0700 Subject: [PATCH] Fix OBO error in multi_frame_dataset In some datasets, this meant one frame was included in a sequence where it didn't belong. In datasets with mismatched chunk sizes, this resulted in an error. --- codes/data/multi_frame_dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codes/data/multi_frame_dataset.py b/codes/data/multi_frame_dataset.py index 1dd81477..c8f14fe1 100644 --- a/codes/data/multi_frame_dataset.py +++ b/codes/data/multi_frame_dataset.py @@ -15,9 +15,9 @@ class MultiFrameDataset(BaseUnsupervisedImageDataset): def get_sequential_image_paths_from(self, chunk_index, chunk_offset): im_name = self.chunk_name(chunk_index) source_name = im_name[:-12] - frames_needed = self.num_frames - 1 # Search backwards for the frames needed. We are assuming that every video in the dataset has at least frames_needed frames. - search_idx = chunk_index-1 + frames_needed = self.num_frames + search_idx = chunk_index while frames_needed > 0: if source_name in self.chunk_name(search_idx): frames_needed -= 1