in dataset/dataset_kinetics.py [0:0]
def __init__(self, root, split='train', **kwargs):
super(KineticsClipFolderDataset, self).__init__()
if '##' in root: # super resource
data_root_split = root.split('##')
assert len(data_root_split) == 2
root = data_root_split[0]
self.dataset_frame_root_ssd = os.path.join(data_root_split[1], 'data')
assert '#' not in self.dataset_frame_root_ssd
assert os.path.exists(self.dataset_frame_root_ssd)
else:
self.dataset_frame_root_ssd = None
# dataset root
if '#' in root: # multiple data resources
self.dataset_root = root.split('#')
else:
self.dataset_root = [root]
for p in self.dataset_root:
if not os.path.exists(p):
print(p)
assert False
self.dataset_root_num = len(self.dataset_root)
print('using {} data sources'.format(self.dataset_root_num))
# data frame root
self.dataset_frame_root = [os.path.join(p, split) for p in self.dataset_root]
for p in self.dataset_frame_root:
assert os.path.exists(p)
# data list file
assert split in ('train', 'val')
self.dataset_list_file = os.path.join(self.dataset_root[0], split + '.txt')
assert os.path.exists(self.dataset_list_file)
# load vid samples
self.samples = self._load_list(self.dataset_list_file)
self.transform = None