anticipation/anticipation/datasets/epic_future_labels.py [120:142]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        vid_lengths = open(self.ann_file.replace('.csv', '_nframes.csv')).read().strip().split('\n')
        vid_lengths = [line.split('\t') for line in vid_lengths]
        vid_lengths = {k:int(v) for k,v in vid_lengths}
       
        records = [EpicRawFramesRecord(x.strip().split('\t')) for x in open(ann_file)]
        records_by_vid = collections.defaultdict(list)
        for record in records:
            record.uid = '%s_%s_%s'%(record.path, record.start_frame, record.end_frame)
            records_by_vid[record.path].append(record)

        records = []
        for vid in records_by_vid:
            vrecords = sorted(records_by_vid[vid], key=lambda record: record.end_frame)
            length = vid_lengths[vid]

            if self.test_mode:
                timestamps = self.val_timestamps # 0.5, 0.75, 1.0]
            else:
                timestamps = self.train_timestamps # 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]

            timestamps = [int(frac*length) for frac in timestamps]
            for i, t in enumerate(timestamps):
                past_records = [record for record in vrecords if record.end_frame<=t]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



anticipation/anticipation/datasets/epic_future_labels.py [158:181]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        vid_lengths = open(self.ann_file.replace('.csv', '_nframes.csv')).read().strip().split('\n')
        vid_lengths = [line.split('\t') for line in vid_lengths]
        vid_lengths = {k:int(v) for k,v in vid_lengths}

        records = [EpicRawFramesRecord(x.strip().split('\t')) for x in open(ann_file)]

        records_by_vid = collections.defaultdict(list)
        for record in records:
            record.uid = '%s_%s_%s'%(record.path, record.start_frame, record.end_frame)
            records_by_vid[record.path].append(record)

        records = []
        for vid in records_by_vid:
            vrecords = sorted(records_by_vid[vid], key=lambda record: record.end_frame)
            length = vid_lengths[vid]

            if self.test_mode:
                timestamps = self.val_timestamps
            else:
                timestamps = self.train_timestamps                           # [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]
        
            timestamps = [int(frac*length) for frac in timestamps]
            for i, t in enumerate(timestamps):
                past_records = [record for record in vrecords if record.end_frame<=t]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



