def select_fold_ucf101()

in datasets/AVideoDataset.py [0:0]


def select_fold_ucf101(root, video_list, annotation_path, fold, train, num_shots=-1):
        name = "train" if train else "test"
        name = "{}list{:02d}.txt".format(name, fold)
        f = os.path.join(annotation_path, name)
        print(f)
        selected_files = []
        with open(f, "r") as fid:
            data = fid.readlines()
            data = [x.strip().split(" ") for x in data]
            data = [x[0] for x in data]
            selected_files.extend(data)
        selected_files = set(selected_files)
        if num_shots != -1 and num_shots > 0:
            indices = [i for i in range(len(video_list)) if video_list[i][len(root):] in selected_files]
            indices = few_shot_setup(self.samples, indices, num_shots=self.num_shots)
            print(f"Number of videos: {len(indices)}")
        else:
            indices = [i for i in range(len(video_list)) if video_list[i][len(root):] in selected_files]
        return indices