-
Notifications
You must be signed in to change notification settings - Fork 5
/
dataset.py
executable file
·48 lines (40 loc) · 1.46 KB
/
dataset.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# from datasets.kinetics import Kinetics
from datasets.quva import QUVA
from datasets.ucf_aug import UCF_AUG
from datasets.yt_seg import YT_SEG
def get_training_set(opt, spatial_transform, target_transform):
assert opt.train_dataset in ['ucf_aug']
if opt.train_dataset == 'ucf_aug':
training_data = UCF_AUG(
opt.dataset_path,
'train',
sample_duration=opt.sample_duration,
opt=opt,
n_samples_for_each_video=10,
spatial_transform=spatial_transform)
return training_data
def get_validation_set(dataset, spatial_transform, target_transform, opt):
assert dataset in ['quva', 'ucf_aug', 'yt_seg']
if dataset == 'quva':
validation_data = QUVA(
opt.dataset_path,
'val',
sample_duration=opt.sample_duration,
n_samples_for_each_video=1,
spatial_transform=spatial_transform)
elif dataset == 'ucf_aug':
validation_data = UCF_AUG(
opt.dataset_path,
'val',
sample_duration=opt.sample_duration,
opt=opt,
n_samples_for_each_video=1,
spatial_transform=spatial_transform)
elif dataset == 'yt_seg':
validation_data = YT_SEG(
opt.dataset_path,
'val',
sample_duration=opt.sample_duration,
n_samples_for_each_video=1,
spatial_transform=spatial_transform)
return validation_data