def load_annotations(self):
        """Load annotation file to get video information."""
        if self.ann_file.endswith('.json'):
            return self.load_json_annotations()

        video_infos = []
        with open(self.ann_file, 'r') as fin:
            for line in fin:
                line_split = line.strip().split()
                if self.multi_class:
                    assert self.num_classes is not None
                    filename = []
                    label = []
                    for item in line_split:
                        try:
                            label.append(int(item))
                        except:
                            filename.append(item)
                    filename = ' '.join(filename)
                    label = list(map(int, label))
                else:
                    filename = ' '.join(line_split[:-1])
                    label = int(line_split[-1])
                if self.data_prefix is not None:
                    filename = osp.join(self.data_prefix, filename)
                video_infos.append(dict(filename=filename, label=label, tar=self.use_tar_format))
        return video_infos
Load annotation file to get video information.
EVA-01/video/datasets/build.py