-
Notifications
You must be signed in to change notification settings - Fork 19
/
config.py
280 lines (176 loc) · 5.97 KB
/
config.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# Copyright (c) SenseTime. All Rights Reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from yacs.config import CfgNode as CN
__C = CN()
cfg = __C
__C.META_ARC = "siamgat_googlenet"
__C.CUDA = True
# ------------------------------------------------------------------------ #
# Training options
# ------------------------------------------------------------------------ #
__C.TRAIN = CN()
__C.TRAIN.EXEMPLAR_SIZE = 127
__C.TRAIN.SEARCH_SIZE = 287
__C.TRAIN.OUTPUT_SIZE = 25
__C.TRAIN.RESUME = ''
__C.TRAIN.PRETRAINED = ''
__C.TRAIN.LOG_DIR = './logs'
__C.TRAIN.SNAPSHOT_DIR = './snapshot'
__C.TRAIN.EPOCH = 20
__C.TRAIN.START_EPOCH = 0
__C.TRAIN.BATCH_SIZE = 32
__C.TRAIN.NUM_WORKERS = 4 # 1
__C.TRAIN.MOMENTUM = 0.9
__C.TRAIN.WEIGHT_DECAY = 0.0001
__C.TRAIN.CLS_WEIGHT = 1.0
__C.TRAIN.LOC_WEIGHT = 3.0
__C.TRAIN.CEN_WEIGHT = 1.0
__C.TRAIN.PRINT_FREQ = 20
__C.TRAIN.LOG_GRADS = False
__C.TRAIN.GRAD_CLIP = 10.0
__C.TRAIN.BASE_LR = 0.005
__C.TRAIN.LR = CN()
__C.TRAIN.LR.TYPE = 'log'
__C.TRAIN.LR.KWARGS = CN(new_allowed=True)
__C.TRAIN.LR_WARMUP = CN()
__C.TRAIN.LR_WARMUP.WARMUP = True
__C.TRAIN.LR_WARMUP.TYPE = 'step'
__C.TRAIN.LR_WARMUP.EPOCH = 5
__C.TRAIN.LR_WARMUP.KWARGS = CN(new_allowed=True)
__C.TRAIN.NUM_CLASSES = 2
__C.TRAIN.NUM_CONVS = 4
__C.TRAIN.PRIOR_PROB = 0.01
__C.TRAIN.LOSS_ALPHA = 0.25
__C.TRAIN.LOSS_GAMMA = 2.0
__C.TRAIN.CHANNEL_NUM = 256
# ------------------------------------------------------------------------ #
# Dataset options
# ------------------------------------------------------------------------ #
__C.DATASET = CN(new_allowed=True)
# Augmentation
# for template
__C.DATASET.TEMPLATE = CN()
# for detail discussion
__C.DATASET.TEMPLATE.SHIFT = 4
__C.DATASET.TEMPLATE.SCALE = 0.05
__C.DATASET.TEMPLATE.BLUR = 0.0
__C.DATASET.TEMPLATE.FLIP = 0.0
__C.DATASET.TEMPLATE.COLOR = 1.0
__C.DATASET.SEARCH = CN()
__C.DATASET.SEARCH.SHIFT = 64
__C.DATASET.SEARCH.SCALE = 0.18
__C.DATASET.SEARCH.BLUR = 0.0
__C.DATASET.SEARCH.FLIP = 0.0
__C.DATASET.SEARCH.COLOR = 1.0
# for detail discussion
__C.DATASET.NEG = 0.0
__C.DATASET.GRAY = 0.0
__C.DATASET.NAMES = ('VID', 'COCO', 'DET', 'YOUTUBEBB', 'GOT', 'LaSOT', 'TrackingNet')
__C.DATASET.VID = CN()
__C.DATASET.VID.ROOT = '/PATH/TO/VID'
__C.DATASET.VID.ANNO = 'training_dataset/vid/train.json'
__C.DATASET.VID.FRAME_RANGE = 100
__C.DATASET.VID.NUM_USE = 100000 # repeat until reach NUM_USE
__C.DATASET.YOUTUBEBB = CN()
__C.DATASET.YOUTUBEBB.ROOT = '/PATH/TO/YTBB'
__C.DATASET.YOUTUBEBB.ANNO = 'training_dataset/yt_bb/train.json'
__C.DATASET.YOUTUBEBB.FRAME_RANGE = 3
__C.DATASET.YOUTUBEBB.NUM_USE = 200000
__C.DATASET.COCO = CN()
__C.DATASET.COCO.ROOT = '/PATH/TO/COCO'
__C.DATASET.COCO.ANNO = 'training_dataset/coco/train2017.json'
__C.DATASET.COCO.FRAME_RANGE = 1
__C.DATASET.COCO.NUM_USE = 50000
__C.DATASET.DET = CN()
__C.DATASET.DET.ROOT = '/PATH/TO/DET'
__C.DATASET.DET.ANNO = 'training_dataset/det/train.json'
__C.DATASET.DET.FRAME_RANGE = 1
__C.DATASET.DET.NUM_USE = 50000
__C.DATASET.GOT = CN()
__C.DATASET.GOT.ROOT = '/PATH/TO/GOT'
__C.DATASET.GOT.ANNO = 'training_dataset/got10k/train.json'
__C.DATASET.GOT.FRAME_RANGE = 50
__C.DATASET.GOT.NUM_USE = 200000
__C.DATASET.LaSOT = CN()
__C.DATASET.LaSOT.ROOT = '/PATH/TO/LaSOT'
__C.DATASET.LaSOT.ANNO = 'training_dataset/lasot/train.json'
__C.DATASET.LaSOT.FRAME_RANGE = 100
__C.DATASET.LaSOT.NUM_USE = 150000
__C.DATASET.TrackingNet = CN()
__C.DATASET.TrackingNet.ROOT = '/PATH/TO/TrackingNet'
__C.DATASET.TrackingNet.ANNO = 'training_dataset/trackingnet/train.json'
__C.DATASET.TrackingNet.FRAME_RANGE = 100
__C.DATASET.TrackingNet.NUM_USE = 350000
__C.DATASET.VIDEOS_PER_EPOCH = 800000
# ------------------------------------------------------------------------ #
# Backbone options
# ------------------------------------------------------------------------ #
__C.BACKBONE = CN()
# Backbone type, current only support googlenet;alexnet;
__C.BACKBONE.TYPE = 'googlenet'
__C.BACKBONE.KWARGS = CN(new_allowed=True)
# Pretrained backbone weights
__C.BACKBONE.PRETRAINED = ''
# Train backbone layers
__C.BACKBONE.TRAIN_LAYERS = []
# Train channel_layer
__C.BACKBONE.CHANNEL_REDUCE_LAYERS = []
# Layer LR
__C.BACKBONE.LAYERS_LR = 0.1
# Crop_pad
__C.BACKBONE.CROP_PAD = 4
# Switch to train layer
__C.BACKBONE.TRAIN_EPOCH = 10
# Backbone offset
__C.BACKBONE.OFFSET = 13
# Backbone stride
__C.BACKBONE.STRIDE = 8
# ------------------------------------------------------------------------ #
# Adjust layer options
# ------------------------------------------------------------------------ #
__C.ADJUST = CN()
# Adjust layer
__C.ADJUST.ADJUST = True
__C.ADJUST.KWARGS = CN(new_allowed=True)
# Adjust layer type
__C.ADJUST.TYPE = "GoogLeNetAdjustLayer"
# ------------------------------------------------------------------------ #
# Tracker options
# ------------------------------------------------------------------------ #
__C.TRACK = CN()
# SiamGAT
__C.TRAIN.ATTENTION = True
__C.TRACK.TYPE = 'SiamGATTracker'
# Scale penalty
__C.TRACK.PENALTY_K = 0.04
# Window influence
__C.TRACK.WINDOW_INFLUENCE = 0.44
# Interpolation learning rate
__C.TRACK.LR = 0.4
# Exemplar size
__C.TRACK.EXEMPLAR_SIZE = 127
# Instance size
__C.TRACK.INSTANCE_SIZE = 287
# Context amount
__C.TRACK.CONTEXT_AMOUNT = 0.5
__C.TRACK.STRIDE = 8
__C.TRACK.OFFSET = 45
__C.TRACK.SCORE_SIZE = 25
__C.TRACK.hanming = True
__C.TRACK.REGION_S = 0.1
__C.TRACK.REGION_L = 0.44
# ------------------------------------------------------------------------ #
# HP_SEARCH parameters
# ------------------------------------------------------------------------ #
__C.HP_SEARCH = CN()
__C.HP_SEARCH.OTB100 = [0.28, 0.16, 0.4]
# __C.HP_SEARCH.OTB100 = [0.32, 0.3, 0.38]
__C.HP_SEARCH.GOT_10k = [0.7, 0.02, 0.35]
# __C.HP_SEARCH.GOT_10k = [0.9, 0.25, 0.35]
__C.HP_SEARCH.UAV123 = [0.24, 0.04, 0.04]
__C.HP_SEARCH.LaSOT = [0.35, 0.05, 0.18]
# __C.HP_SEARCH.LaSOT = [0.45, 0.05, 0.18]
# __C.HP_SEARCH.TrackingNet = [0.4, 0.05, 0.4]