-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataset_configs.py
153 lines (150 loc) · 4.18 KB
/
dataset_configs.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
"""
Add dataset configurations here. Each dataset must have the following structure:
NAME = {
IMAGE_HEIGHT: int,
IMAGE_WIDTH: int,
ITEMS_TO_DESCRIPTIONS: {
'image_a': 'A 3-channel image.',
'image_b': 'A 3-channel image.',
'flow': 'A 2-channel optical flow field',
},
SIZES: {
'train': int,
'validate': int, (optional)
...
},
BATCH_SIZE: int,
PATHS: {
'train': '',
'validate': '', (optional)
...
}
}
"""
"""
note that one step = one batch of data processed, ~not~ an entire epoch
'coeff_schedule_param': {
'half_life': 50000, after this many steps, the value will be i + (f - i)/2
'initial_coeff': 0.5, initial value
'final_coeff': 1, final value
},
"""
FLYING_CHAIRS_DATASET_CONFIG = {
'IMAGE_HEIGHT': 384,
'IMAGE_WIDTH': 512,
'ITEMS_TO_DESCRIPTIONS': {
'image_a': 'A 3-channel image.',
'image_b': 'A 3-channel image.',
'flow': 'A 2-channel optical flow field',
},
'SIZES': {
'train': 22232,
'validate': 640,
'sample': 8,
},
'BATCH_SIZE': 8,
'PATHS': {
'train': './data/tfrecords/fc_train.tfrecords',
'validate': './data/tfrecords/fc_val.tfrecords',
'sample': './data/tfrecords/fc_sample.tfrecords',
},
'PREPROCESS': {
'scale': False,
'crop_height': 320,
'crop_width': 448,
'image_a': {
'translate': {
'rand_type': "uniform_bernoulli",
'exp': False,
'mean': 0,
'spread': 0.4,
'prob': 1.0,
},
'rotate': {
'rand_type': "uniform_bernoulli",
'exp': False,
'mean': 0,
'spread': 0.4,
'prob': 1.0,
},
'zoom': {
'rand_type': "uniform_bernoulli",
'exp': True,
'mean': 0.2,
'spread': 0.4,
'prob': 1.0,
},
'squeeze': {
'rand_type': "uniform_bernoulli",
'exp': True,
'mean': 0,
'spread': 0.3,
'prob': 1.0,
},
'noise': {
'rand_type': "uniform_bernoulli",
'exp': False,
'mean': 0.03,
'spread': 0.03,
'prob': 1.0,
},
},
# All preprocessing to image A will be applied to image B in addition to the following.
'image_b': {
'translate': {
'rand_type': "gaussian_bernoulli",
'exp': False,
'mean': 0,
'spread': 0.03,
'prob': 1.0,
},
'rotate': {
'rand_type': "gaussian_bernoulli",
'exp': False,
'mean': 0,
'spread': 0.03,
'prob': 1.0,
},
'zoom': {
'rand_type': "gaussian_bernoulli",
'exp': True,
'mean': 0,
'spread': 0.03,
'prob': 1.0,
},
'gamma': {
'rand_type': "gaussian_bernoulli",
'exp': True,
'mean': 0,
'spread': 0.02,
'prob': 1.0,
},
'brightness': {
'rand_type': "gaussian_bernoulli",
'exp': False,
'mean': 0,
'spread': 0.02,
'prob': 1.0,
},
'contrast': {
'rand_type': "gaussian_bernoulli",
'exp': True,
'mean': 0,
'spread': 0.02,
'prob': 1.0,
},
'color': {
'rand_type': "gaussian_bernoulli",
'exp': True,
'mean': 0,
'spread': 0.02,
'prob': 1.0,
},
'coeff_schedule_param': {
'half_life': 50000,
'initial_coeff': 0.5,
'final_coeff': 1,
},
}
},
}