czm369 commited on
Commit
6f16186
·
verified ·
1 Parent(s): f8a10c2

Upload 6 files

Browse files
mixpl_dino-4scale_r50_90k_coco-s1-p10.py/20230419_192513/20230419_192513.log ADDED
The diff for this file is too large to render. See raw diff
 
mixpl_dino-4scale_r50_90k_coco-s1-p10.py/20230419_192513/vis_data/20230419_192513.json ADDED
The diff for this file is too large to render. See raw diff
 
mixpl_dino-4scale_r50_90k_coco-s1-p10.py/20230419_192513/vis_data/config.py ADDED
@@ -0,0 +1,742 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ default_scope = 'mmdet'
2
+ default_hooks = dict(
3
+ timer=dict(type='IterTimerHook'),
4
+ logger=dict(type='LoggerHook', interval=50),
5
+ param_scheduler=dict(type='ParamSchedulerHook'),
6
+ checkpoint=dict(
7
+ type='CheckpointHook',
8
+ interval=10000,
9
+ by_epoch=False,
10
+ max_keep_ckpts=1),
11
+ sampler_seed=dict(type='DistSamplerSeedHook'),
12
+ visualization=dict(type='DetVisualizationHook'))
13
+ env_cfg = dict(
14
+ cudnn_benchmark=False,
15
+ mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
16
+ dist_cfg=dict(backend='nccl'))
17
+ vis_backends = [dict(type='LocalVisBackend')]
18
+ visualizer = dict(
19
+ type='DetLocalVisualizer',
20
+ vis_backends=[dict(type='LocalVisBackend')],
21
+ name='visualizer')
22
+ log_processor = dict(type='LogProcessor', window_size=50, by_epoch=False)
23
+ log_level = 'INFO'
24
+ load_from = None
25
+ resume = True
26
+ dataset_type = 'CocoDataset'
27
+ data_root = 'data/coco/'
28
+ file_client_args = dict(backend='disk')
29
+ color_space = [[{
30
+ 'type': 'ColorTransform'
31
+ }], [{
32
+ 'type': 'AutoContrast'
33
+ }], [{
34
+ 'type': 'Equalize'
35
+ }], [{
36
+ 'type': 'Sharpness'
37
+ }], [{
38
+ 'type': 'Posterize'
39
+ }], [{
40
+ 'type': 'Solarize'
41
+ }], [{
42
+ 'type': 'Color'
43
+ }], [{
44
+ 'type': 'Contrast'
45
+ }], [{
46
+ 'type': 'Brightness'
47
+ }]]
48
+ geometric = [[{
49
+ 'type': 'Rotate'
50
+ }], [{
51
+ 'type': 'ShearX'
52
+ }], [{
53
+ 'type': 'ShearY'
54
+ }], [{
55
+ 'type': 'TranslateX'
56
+ }], [{
57
+ 'type': 'TranslateY'
58
+ }]]
59
+ scale = [(1333, 400), (1333, 1200)]
60
+ branch_field = ['sup', 'unsup_teacher', 'unsup_student']
61
+ sup_pipeline = [
62
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
63
+ dict(type='LoadAnnotations', with_bbox=True),
64
+ dict(
65
+ type='RandomResize',
66
+ scale=[(1333, 400), (1333, 1200)],
67
+ keep_ratio=True),
68
+ dict(type='RandomFlip', prob=0.5),
69
+ dict(
70
+ type='RandAugment',
71
+ aug_space=[[{
72
+ 'type': 'ColorTransform'
73
+ }], [{
74
+ 'type': 'AutoContrast'
75
+ }], [{
76
+ 'type': 'Equalize'
77
+ }], [{
78
+ 'type': 'Sharpness'
79
+ }], [{
80
+ 'type': 'Posterize'
81
+ }], [{
82
+ 'type': 'Solarize'
83
+ }], [{
84
+ 'type': 'Color'
85
+ }], [{
86
+ 'type': 'Contrast'
87
+ }], [{
88
+ 'type': 'Brightness'
89
+ }]],
90
+ aug_num=1),
91
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
92
+ dict(
93
+ type='MultiBranch',
94
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
95
+ sup=dict(type='PackDetInputs'))
96
+ ]
97
+ weak_pipeline = [
98
+ dict(
99
+ type='RandomResize',
100
+ scale=[(1333, 400), (1333, 1200)],
101
+ keep_ratio=True),
102
+ dict(type='RandomFlip', prob=0.5),
103
+ dict(
104
+ type='PackDetInputs',
105
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
106
+ 'scale_factor', 'flip', 'flip_direction',
107
+ 'homography_matrix'))
108
+ ]
109
+ strong_pipeline = [
110
+ dict(
111
+ type='RandomResize',
112
+ scale=[(1333, 400), (1333, 1200)],
113
+ keep_ratio=True),
114
+ dict(type='RandomFlip', prob=0.5),
115
+ dict(
116
+ type='RandomOrder',
117
+ transforms=[
118
+ dict(
119
+ type='RandAugment',
120
+ aug_space=[[{
121
+ 'type': 'ColorTransform'
122
+ }], [{
123
+ 'type': 'AutoContrast'
124
+ }], [{
125
+ 'type': 'Equalize'
126
+ }], [{
127
+ 'type': 'Sharpness'
128
+ }], [{
129
+ 'type': 'Posterize'
130
+ }], [{
131
+ 'type': 'Solarize'
132
+ }], [{
133
+ 'type': 'Color'
134
+ }], [{
135
+ 'type': 'Contrast'
136
+ }], [{
137
+ 'type': 'Brightness'
138
+ }]],
139
+ aug_num=1),
140
+ dict(
141
+ type='RandAugment',
142
+ aug_space=[[{
143
+ 'type': 'Rotate'
144
+ }], [{
145
+ 'type': 'ShearX'
146
+ }], [{
147
+ 'type': 'ShearY'
148
+ }], [{
149
+ 'type': 'TranslateX'
150
+ }], [{
151
+ 'type': 'TranslateY'
152
+ }]],
153
+ aug_num=1)
154
+ ]),
155
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
156
+ dict(
157
+ type='PackDetInputs',
158
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
159
+ 'scale_factor', 'flip', 'flip_direction',
160
+ 'homography_matrix'))
161
+ ]
162
+ unsup_pipeline = [
163
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
164
+ dict(type='LoadAnnotations', with_bbox=True),
165
+ dict(
166
+ type='MultiBranch',
167
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
168
+ unsup_teacher=[
169
+ dict(
170
+ type='RandomResize',
171
+ scale=[(1333, 400), (1333, 1200)],
172
+ keep_ratio=True),
173
+ dict(type='RandomFlip', prob=0.5),
174
+ dict(
175
+ type='PackDetInputs',
176
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
177
+ 'scale_factor', 'flip', 'flip_direction',
178
+ 'homography_matrix'))
179
+ ],
180
+ unsup_student=[
181
+ dict(
182
+ type='RandomResize',
183
+ scale=[(1333, 400), (1333, 1200)],
184
+ keep_ratio=True),
185
+ dict(type='RandomFlip', prob=0.5),
186
+ dict(
187
+ type='RandomOrder',
188
+ transforms=[
189
+ dict(
190
+ type='RandAugment',
191
+ aug_space=[[{
192
+ 'type': 'ColorTransform'
193
+ }], [{
194
+ 'type': 'AutoContrast'
195
+ }], [{
196
+ 'type': 'Equalize'
197
+ }], [{
198
+ 'type': 'Sharpness'
199
+ }], [{
200
+ 'type': 'Posterize'
201
+ }], [{
202
+ 'type': 'Solarize'
203
+ }], [{
204
+ 'type': 'Color'
205
+ }], [{
206
+ 'type': 'Contrast'
207
+ }], [{
208
+ 'type': 'Brightness'
209
+ }]],
210
+ aug_num=1),
211
+ dict(
212
+ type='RandAugment',
213
+ aug_space=[[{
214
+ 'type': 'Rotate'
215
+ }], [{
216
+ 'type': 'ShearX'
217
+ }], [{
218
+ 'type': 'ShearY'
219
+ }], [{
220
+ 'type': 'TranslateX'
221
+ }], [{
222
+ 'type': 'TranslateY'
223
+ }]],
224
+ aug_num=1)
225
+ ]),
226
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
227
+ dict(
228
+ type='PackDetInputs',
229
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
230
+ 'scale_factor', 'flip', 'flip_direction',
231
+ 'homography_matrix'))
232
+ ])
233
+ ]
234
+ test_pipeline = [
235
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
236
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
237
+ dict(
238
+ type='PackDetInputs',
239
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
240
+ 'scale_factor'))
241
+ ]
242
+ batch_size = 8
243
+ num_workers = 8
244
+ labeled_dataset = dict(
245
+ type='CocoDataset',
246
+ data_root='data/',
247
+ ann_file='coco_semi_anns/instances_train2017.1@10.json',
248
+ data_prefix=dict(img='coco/train2017/'),
249
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
250
+ pipeline=[
251
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
252
+ dict(type='LoadAnnotations', with_bbox=True),
253
+ dict(
254
+ type='RandomResize',
255
+ scale=[(1333, 400), (1333, 1200)],
256
+ keep_ratio=True),
257
+ dict(type='RandomFlip', prob=0.5),
258
+ dict(
259
+ type='RandAugment',
260
+ aug_space=[[{
261
+ 'type': 'ColorTransform'
262
+ }], [{
263
+ 'type': 'AutoContrast'
264
+ }], [{
265
+ 'type': 'Equalize'
266
+ }], [{
267
+ 'type': 'Sharpness'
268
+ }], [{
269
+ 'type': 'Posterize'
270
+ }], [{
271
+ 'type': 'Solarize'
272
+ }], [{
273
+ 'type': 'Color'
274
+ }], [{
275
+ 'type': 'Contrast'
276
+ }], [{
277
+ 'type': 'Brightness'
278
+ }]],
279
+ aug_num=1),
280
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
281
+ dict(
282
+ type='MultiBranch',
283
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
284
+ sup=dict(type='PackDetInputs'))
285
+ ])
286
+ unlabeled_dataset = dict(
287
+ type='CocoDataset',
288
+ data_root='data/',
289
+ ann_file='coco_semi_anns/instances_train2017.1@10-unlabeled.json',
290
+ data_prefix=dict(img='coco/train2017/'),
291
+ filter_cfg=dict(filter_empty_gt=False),
292
+ pipeline=[
293
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
294
+ dict(type='LoadAnnotations', with_bbox=True),
295
+ dict(
296
+ type='MultiBranch',
297
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
298
+ unsup_teacher=[
299
+ dict(
300
+ type='RandomResize',
301
+ scale=[(1333, 400), (1333, 1200)],
302
+ keep_ratio=True),
303
+ dict(type='RandomFlip', prob=0.5),
304
+ dict(
305
+ type='PackDetInputs',
306
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
307
+ 'scale_factor', 'flip', 'flip_direction',
308
+ 'homography_matrix'))
309
+ ],
310
+ unsup_student=[
311
+ dict(
312
+ type='RandomResize',
313
+ scale=[(1333, 400), (1333, 1200)],
314
+ keep_ratio=True),
315
+ dict(type='RandomFlip', prob=0.5),
316
+ dict(
317
+ type='RandomOrder',
318
+ transforms=[
319
+ dict(
320
+ type='RandAugment',
321
+ aug_space=[[{
322
+ 'type': 'ColorTransform'
323
+ }], [{
324
+ 'type': 'AutoContrast'
325
+ }], [{
326
+ 'type': 'Equalize'
327
+ }], [{
328
+ 'type': 'Sharpness'
329
+ }], [{
330
+ 'type': 'Posterize'
331
+ }], [{
332
+ 'type': 'Solarize'
333
+ }], [{
334
+ 'type': 'Color'
335
+ }], [{
336
+ 'type': 'Contrast'
337
+ }], [{
338
+ 'type': 'Brightness'
339
+ }]],
340
+ aug_num=1),
341
+ dict(
342
+ type='RandAugment',
343
+ aug_space=[[{
344
+ 'type': 'Rotate'
345
+ }], [{
346
+ 'type': 'ShearX'
347
+ }], [{
348
+ 'type': 'ShearY'
349
+ }], [{
350
+ 'type': 'TranslateX'
351
+ }], [{
352
+ 'type': 'TranslateY'
353
+ }]],
354
+ aug_num=1)
355
+ ]),
356
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
357
+ dict(
358
+ type='PackDetInputs',
359
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
360
+ 'scale_factor', 'flip', 'flip_direction',
361
+ 'homography_matrix'))
362
+ ])
363
+ ])
364
+ train_dataloader = dict(
365
+ batch_size=5,
366
+ num_workers=5,
367
+ persistent_workers=True,
368
+ sampler=dict(
369
+ type='GroupMultiSourceSampler', batch_size=5, source_ratio=[1, 4]),
370
+ dataset=dict(
371
+ type='ConcatDataset',
372
+ datasets=[
373
+ dict(
374
+ type='CocoDataset',
375
+ data_root='data/',
376
+ ann_file='coco_semi_anns/instances_train2017.1@10.json',
377
+ data_prefix=dict(img='coco/train2017/'),
378
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
379
+ pipeline=[
380
+ dict(
381
+ type='LoadImageFromFile',
382
+ file_client_args=dict(backend='disk')),
383
+ dict(type='LoadAnnotations', with_bbox=True),
384
+ dict(
385
+ type='RandomResize',
386
+ scale=[(1333, 400), (1333, 1200)],
387
+ keep_ratio=True),
388
+ dict(type='RandomFlip', prob=0.5),
389
+ dict(
390
+ type='RandAugment',
391
+ aug_space=[[{
392
+ 'type': 'ColorTransform'
393
+ }], [{
394
+ 'type': 'AutoContrast'
395
+ }], [{
396
+ 'type': 'Equalize'
397
+ }], [{
398
+ 'type': 'Sharpness'
399
+ }], [{
400
+ 'type': 'Posterize'
401
+ }], [{
402
+ 'type': 'Solarize'
403
+ }], [{
404
+ 'type': 'Color'
405
+ }], [{
406
+ 'type': 'Contrast'
407
+ }], [{
408
+ 'type': 'Brightness'
409
+ }]],
410
+ aug_num=1),
411
+ dict(
412
+ type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
413
+ dict(
414
+ type='MultiBranch',
415
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
416
+ sup=dict(type='PackDetInputs'))
417
+ ]),
418
+ dict(
419
+ type='CocoDataset',
420
+ data_root='data/',
421
+ ann_file=
422
+ 'coco_semi_anns/instances_train2017.1@10-unlabeled.json',
423
+ data_prefix=dict(img='coco/train2017/'),
424
+ filter_cfg=dict(filter_empty_gt=False),
425
+ pipeline=[
426
+ dict(
427
+ type='LoadImageFromFile',
428
+ file_client_args=dict(backend='disk')),
429
+ dict(type='LoadAnnotations', with_bbox=True),
430
+ dict(
431
+ type='MultiBranch',
432
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
433
+ unsup_teacher=[
434
+ dict(
435
+ type='RandomResize',
436
+ scale=[(1333, 400), (1333, 1200)],
437
+ keep_ratio=True),
438
+ dict(type='RandomFlip', prob=0.5),
439
+ dict(
440
+ type='PackDetInputs',
441
+ meta_keys=('img_id', 'img_path', 'ori_shape',
442
+ 'img_shape', 'scale_factor', 'flip',
443
+ 'flip_direction',
444
+ 'homography_matrix'))
445
+ ],
446
+ unsup_student=[
447
+ dict(
448
+ type='RandomResize',
449
+ scale=[(1333, 400), (1333, 1200)],
450
+ keep_ratio=True),
451
+ dict(type='RandomFlip', prob=0.5),
452
+ dict(
453
+ type='RandomOrder',
454
+ transforms=[
455
+ dict(
456
+ type='RandAugment',
457
+ aug_space=[[{
458
+ 'type': 'ColorTransform'
459
+ }], [{
460
+ 'type': 'AutoContrast'
461
+ }], [{
462
+ 'type': 'Equalize'
463
+ }], [{
464
+ 'type': 'Sharpness'
465
+ }], [{
466
+ 'type': 'Posterize'
467
+ }], [{
468
+ 'type': 'Solarize'
469
+ }], [{
470
+ 'type': 'Color'
471
+ }], [{
472
+ 'type': 'Contrast'
473
+ }], [{
474
+ 'type': 'Brightness'
475
+ }]],
476
+ aug_num=1),
477
+ dict(
478
+ type='RandAugment',
479
+ aug_space=[[{
480
+ 'type': 'Rotate'
481
+ }], [{
482
+ 'type': 'ShearX'
483
+ }], [{
484
+ 'type': 'ShearY'
485
+ }], [{
486
+ 'type': 'TranslateX'
487
+ }], [{
488
+ 'type': 'TranslateY'
489
+ }]],
490
+ aug_num=1)
491
+ ]),
492
+ dict(
493
+ type='FilterAnnotations',
494
+ min_gt_bbox_wh=(0.01, 0.01)),
495
+ dict(
496
+ type='PackDetInputs',
497
+ meta_keys=('img_id', 'img_path', 'ori_shape',
498
+ 'img_shape', 'scale_factor', 'flip',
499
+ 'flip_direction',
500
+ 'homography_matrix'))
501
+ ])
502
+ ])
503
+ ]))
504
+ val_dataloader = dict(
505
+ batch_size=1,
506
+ num_workers=2,
507
+ persistent_workers=True,
508
+ drop_last=False,
509
+ sampler=dict(type='DefaultSampler', shuffle=False),
510
+ dataset=dict(
511
+ type='CocoDataset',
512
+ data_root='data/coco/',
513
+ ann_file='annotations/instances_val2017.json',
514
+ data_prefix=dict(img='val2017/'),
515
+ test_mode=True,
516
+ pipeline=[
517
+ dict(
518
+ type='LoadImageFromFile',
519
+ file_client_args=dict(backend='disk')),
520
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
521
+ dict(
522
+ type='PackDetInputs',
523
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
524
+ 'scale_factor'))
525
+ ]))
526
+ test_dataloader = dict(
527
+ batch_size=1,
528
+ num_workers=2,
529
+ persistent_workers=True,
530
+ drop_last=False,
531
+ sampler=dict(type='DefaultSampler', shuffle=False),
532
+ dataset=dict(
533
+ type='CocoDataset',
534
+ data_root='data/coco/',
535
+ ann_file='annotations/instances_val2017.json',
536
+ data_prefix=dict(img='val2017/'),
537
+ test_mode=True,
538
+ pipeline=[
539
+ dict(
540
+ type='LoadImageFromFile',
541
+ file_client_args=dict(backend='disk')),
542
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
543
+ dict(
544
+ type='PackDetInputs',
545
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
546
+ 'scale_factor'))
547
+ ]))
548
+ val_evaluator = dict(
549
+ type='CocoMetric',
550
+ ann_file='data/coco/annotations/instances_val2017.json',
551
+ metric='bbox',
552
+ format_only=False)
553
+ test_evaluator = dict(
554
+ type='CocoMetric',
555
+ ann_file='data/coco/annotations/instances_val2017.json',
556
+ metric='bbox',
557
+ format_only=False)
558
+ detector = dict(
559
+ type='DINO',
560
+ num_queries=900,
561
+ with_box_refine=True,
562
+ as_two_stage=True,
563
+ data_preprocessor=dict(
564
+ type='DetDataPreprocessor',
565
+ mean=[123.675, 116.28, 103.53],
566
+ std=[58.395, 57.12, 57.375],
567
+ bgr_to_rgb=True,
568
+ pad_size_divisor=1),
569
+ backbone=dict(
570
+ type='ResNet',
571
+ depth=50,
572
+ num_stages=4,
573
+ out_indices=(1, 2, 3),
574
+ frozen_stages=1,
575
+ norm_cfg=dict(type='BN', requires_grad=False),
576
+ norm_eval=True,
577
+ style='pytorch',
578
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
579
+ neck=dict(
580
+ type='ChannelMapper',
581
+ in_channels=[512, 1024, 2048],
582
+ kernel_size=1,
583
+ out_channels=256,
584
+ act_cfg=None,
585
+ norm_cfg=dict(type='GN', num_groups=32),
586
+ num_outs=4),
587
+ encoder=dict(
588
+ num_layers=6,
589
+ layer_cfg=dict(
590
+ self_attn_cfg=dict(embed_dims=256, num_levels=4, dropout=0.0),
591
+ ffn_cfg=dict(
592
+ embed_dims=256, feedforward_channels=2048, ffn_drop=0.0))),
593
+ decoder=dict(
594
+ num_layers=6,
595
+ return_intermediate=True,
596
+ layer_cfg=dict(
597
+ self_attn_cfg=dict(embed_dims=256, num_heads=8, dropout=0.0),
598
+ cross_attn_cfg=dict(embed_dims=256, num_levels=4, dropout=0.0),
599
+ ffn_cfg=dict(
600
+ embed_dims=256, feedforward_channels=2048, ffn_drop=0.0)),
601
+ post_norm_cfg=None),
602
+ positional_encoding=dict(
603
+ num_feats=128, normalize=True, offset=0.0, temperature=20),
604
+ bbox_head=dict(
605
+ type='DINOHead',
606
+ num_classes=80,
607
+ sync_cls_avg_factor=True,
608
+ loss_cls=dict(
609
+ type='FocalLoss',
610
+ use_sigmoid=True,
611
+ gamma=2.0,
612
+ alpha=0.25,
613
+ loss_weight=1.0),
614
+ loss_bbox=dict(type='L1Loss', loss_weight=5.0),
615
+ loss_iou=dict(type='GIoULoss', loss_weight=2.0)),
616
+ dn_cfg=dict(
617
+ label_noise_scale=0.5,
618
+ box_noise_scale=1.0,
619
+ group_cfg=dict(dynamic=True, num_groups=None, num_dn_queries=100)),
620
+ train_cfg=dict(
621
+ assigner=dict(
622
+ type='HungarianAssigner',
623
+ match_costs=[
624
+ dict(type='FocalLossCost', weight=2.0),
625
+ dict(type='BBoxL1Cost', weight=5.0, box_format='xywh'),
626
+ dict(type='IoUCost', iou_mode='giou', weight=2.0)
627
+ ])),
628
+ test_cfg=dict(max_per_img=300))
629
+ work_dir = '/mnt/petrelfs/chenzeming/mixpl/mixpl_dino-4scale_r50_90k_coco-s1-p10.py'
630
+ model = dict(
631
+ type='MixPL',
632
+ detector=dict(
633
+ type='DINO',
634
+ num_queries=900,
635
+ with_box_refine=True,
636
+ as_two_stage=True,
637
+ data_preprocessor=dict(
638
+ type='DetDataPreprocessor',
639
+ mean=[123.675, 116.28, 103.53],
640
+ std=[58.395, 57.12, 57.375],
641
+ bgr_to_rgb=True,
642
+ pad_size_divisor=1),
643
+ backbone=dict(
644
+ type='ResNet',
645
+ depth=50,
646
+ num_stages=4,
647
+ out_indices=(1, 2, 3),
648
+ frozen_stages=1,
649
+ norm_cfg=dict(type='BN', requires_grad=False),
650
+ norm_eval=True,
651
+ style='pytorch',
652
+ init_cfg=dict(
653
+ type='Pretrained', checkpoint='torchvision://resnet50')),
654
+ neck=dict(
655
+ type='ChannelMapper',
656
+ in_channels=[512, 1024, 2048],
657
+ kernel_size=1,
658
+ out_channels=256,
659
+ act_cfg=None,
660
+ norm_cfg=dict(type='GN', num_groups=32),
661
+ num_outs=4),
662
+ encoder=dict(
663
+ num_layers=6,
664
+ layer_cfg=dict(
665
+ self_attn_cfg=dict(embed_dims=256, num_levels=4, dropout=0.0),
666
+ ffn_cfg=dict(
667
+ embed_dims=256, feedforward_channels=2048, ffn_drop=0.0))),
668
+ decoder=dict(
669
+ num_layers=6,
670
+ return_intermediate=True,
671
+ layer_cfg=dict(
672
+ self_attn_cfg=dict(embed_dims=256, num_heads=8, dropout=0.0),
673
+ cross_attn_cfg=dict(embed_dims=256, num_levels=4, dropout=0.0),
674
+ ffn_cfg=dict(
675
+ embed_dims=256, feedforward_channels=2048, ffn_drop=0.0)),
676
+ post_norm_cfg=None),
677
+ positional_encoding=dict(
678
+ num_feats=128, normalize=True, offset=0.0, temperature=20),
679
+ bbox_head=dict(
680
+ type='DINOHead',
681
+ num_classes=80,
682
+ sync_cls_avg_factor=True,
683
+ loss_cls=dict(
684
+ type='FocalLoss',
685
+ use_sigmoid=True,
686
+ gamma=2.0,
687
+ alpha=0.25,
688
+ loss_weight=1.0),
689
+ loss_bbox=dict(type='L1Loss', loss_weight=5.0),
690
+ loss_iou=dict(type='GIoULoss', loss_weight=2.0)),
691
+ dn_cfg=dict(
692
+ label_noise_scale=0.5,
693
+ box_noise_scale=1.0,
694
+ group_cfg=dict(dynamic=True, num_groups=None, num_dn_queries=100)),
695
+ train_cfg=dict(
696
+ assigner=dict(
697
+ type='HungarianAssigner',
698
+ match_costs=[
699
+ dict(type='FocalLossCost', weight=2.0),
700
+ dict(type='BBoxL1Cost', weight=5.0, box_format='xywh'),
701
+ dict(type='IoUCost', iou_mode='giou', weight=2.0)
702
+ ])),
703
+ test_cfg=dict(max_per_img=300)),
704
+ data_preprocessor=dict(
705
+ type='MultiBranchDataPreprocessor',
706
+ data_preprocessor=dict(
707
+ type='DetDataPreprocessor',
708
+ mean=[123.675, 116.28, 103.53],
709
+ std=[58.395, 57.12, 57.375],
710
+ bgr_to_rgb=True,
711
+ pad_size_divisor=1)),
712
+ semi_train_cfg=dict(
713
+ least_num=1,
714
+ cache_size=8,
715
+ mixup=True,
716
+ mosaic=True,
717
+ mosaic_shape=[(400, 400), (800, 800)],
718
+ mosaic_weight=0.5,
719
+ erase=True,
720
+ erase_patches=(1, 20),
721
+ erase_ratio=(0, 0.1),
722
+ erase_thr=0.7,
723
+ cls_pseudo_thr=0.4,
724
+ freeze_teacher=True,
725
+ sup_weight=1.0,
726
+ unsup_weight=2.0,
727
+ min_pseudo_bbox_wh=(0.01, 0.01)),
728
+ semi_test_cfg=dict(predict_on='teacher'))
729
+ train_cfg = dict(type='IterBasedTrainLoop', max_iters=90000, val_interval=5000)
730
+ val_cfg = dict(type='TeacherStudentValLoop')
731
+ test_cfg = dict(type='TestLoop')
732
+ param_scheduler = [
733
+ dict(
734
+ type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500)
735
+ ]
736
+ optim_wrapper = dict(
737
+ type='OptimWrapper',
738
+ optimizer=dict(type='AdamW', lr=0.0001, weight_decay=0.0001),
739
+ clip_grad=dict(max_norm=0.1, norm_type=2),
740
+ paramwise_cfg=dict(custom_keys=dict(backbone=dict(lr_mult=0.1))))
741
+ custom_hooks = [dict(type='AnnealMeanTeacherHook', momentum=0.0002, gamma=4)]
742
+ launcher = 'slurm'
mixpl_dino-4scale_r50_90k_coco-s1-p10.py/20230419_192513/vis_data/scalars.json ADDED
The diff for this file is too large to render. See raw diff
 
mixpl_dino-4scale_r50_90k_coco-s1-p10.py/iter_90000.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db011f327ccddb3f0086f11d5fd6298103f7db2478a04e0f4bbc2357d24161ff
3
+ size 964560885
mixpl_dino-4scale_r50_90k_coco-s1-p10.py/mixpl_dino-4scale_r50_90k_coco-s1-p10.py ADDED
@@ -0,0 +1,742 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ default_scope = 'mmdet'
2
+ default_hooks = dict(
3
+ timer=dict(type='IterTimerHook'),
4
+ logger=dict(type='LoggerHook', interval=50),
5
+ param_scheduler=dict(type='ParamSchedulerHook'),
6
+ checkpoint=dict(
7
+ type='CheckpointHook',
8
+ interval=10000,
9
+ by_epoch=False,
10
+ max_keep_ckpts=1),
11
+ sampler_seed=dict(type='DistSamplerSeedHook'),
12
+ visualization=dict(type='DetVisualizationHook'))
13
+ env_cfg = dict(
14
+ cudnn_benchmark=False,
15
+ mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
16
+ dist_cfg=dict(backend='nccl'))
17
+ vis_backends = [dict(type='LocalVisBackend')]
18
+ visualizer = dict(
19
+ type='DetLocalVisualizer',
20
+ vis_backends=[dict(type='LocalVisBackend')],
21
+ name='visualizer')
22
+ log_processor = dict(type='LogProcessor', window_size=50, by_epoch=False)
23
+ log_level = 'INFO'
24
+ load_from = None
25
+ resume = True
26
+ dataset_type = 'CocoDataset'
27
+ data_root = 'data/coco/'
28
+ file_client_args = dict(backend='disk')
29
+ color_space = [[{
30
+ 'type': 'ColorTransform'
31
+ }], [{
32
+ 'type': 'AutoContrast'
33
+ }], [{
34
+ 'type': 'Equalize'
35
+ }], [{
36
+ 'type': 'Sharpness'
37
+ }], [{
38
+ 'type': 'Posterize'
39
+ }], [{
40
+ 'type': 'Solarize'
41
+ }], [{
42
+ 'type': 'Color'
43
+ }], [{
44
+ 'type': 'Contrast'
45
+ }], [{
46
+ 'type': 'Brightness'
47
+ }]]
48
+ geometric = [[{
49
+ 'type': 'Rotate'
50
+ }], [{
51
+ 'type': 'ShearX'
52
+ }], [{
53
+ 'type': 'ShearY'
54
+ }], [{
55
+ 'type': 'TranslateX'
56
+ }], [{
57
+ 'type': 'TranslateY'
58
+ }]]
59
+ scale = [(1333, 400), (1333, 1200)]
60
+ branch_field = ['sup', 'unsup_teacher', 'unsup_student']
61
+ sup_pipeline = [
62
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
63
+ dict(type='LoadAnnotations', with_bbox=True),
64
+ dict(
65
+ type='RandomResize',
66
+ scale=[(1333, 400), (1333, 1200)],
67
+ keep_ratio=True),
68
+ dict(type='RandomFlip', prob=0.5),
69
+ dict(
70
+ type='RandAugment',
71
+ aug_space=[[{
72
+ 'type': 'ColorTransform'
73
+ }], [{
74
+ 'type': 'AutoContrast'
75
+ }], [{
76
+ 'type': 'Equalize'
77
+ }], [{
78
+ 'type': 'Sharpness'
79
+ }], [{
80
+ 'type': 'Posterize'
81
+ }], [{
82
+ 'type': 'Solarize'
83
+ }], [{
84
+ 'type': 'Color'
85
+ }], [{
86
+ 'type': 'Contrast'
87
+ }], [{
88
+ 'type': 'Brightness'
89
+ }]],
90
+ aug_num=1),
91
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
92
+ dict(
93
+ type='MultiBranch',
94
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
95
+ sup=dict(type='PackDetInputs'))
96
+ ]
97
+ weak_pipeline = [
98
+ dict(
99
+ type='RandomResize',
100
+ scale=[(1333, 400), (1333, 1200)],
101
+ keep_ratio=True),
102
+ dict(type='RandomFlip', prob=0.5),
103
+ dict(
104
+ type='PackDetInputs',
105
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
106
+ 'scale_factor', 'flip', 'flip_direction',
107
+ 'homography_matrix'))
108
+ ]
109
+ strong_pipeline = [
110
+ dict(
111
+ type='RandomResize',
112
+ scale=[(1333, 400), (1333, 1200)],
113
+ keep_ratio=True),
114
+ dict(type='RandomFlip', prob=0.5),
115
+ dict(
116
+ type='RandomOrder',
117
+ transforms=[
118
+ dict(
119
+ type='RandAugment',
120
+ aug_space=[[{
121
+ 'type': 'ColorTransform'
122
+ }], [{
123
+ 'type': 'AutoContrast'
124
+ }], [{
125
+ 'type': 'Equalize'
126
+ }], [{
127
+ 'type': 'Sharpness'
128
+ }], [{
129
+ 'type': 'Posterize'
130
+ }], [{
131
+ 'type': 'Solarize'
132
+ }], [{
133
+ 'type': 'Color'
134
+ }], [{
135
+ 'type': 'Contrast'
136
+ }], [{
137
+ 'type': 'Brightness'
138
+ }]],
139
+ aug_num=1),
140
+ dict(
141
+ type='RandAugment',
142
+ aug_space=[[{
143
+ 'type': 'Rotate'
144
+ }], [{
145
+ 'type': 'ShearX'
146
+ }], [{
147
+ 'type': 'ShearY'
148
+ }], [{
149
+ 'type': 'TranslateX'
150
+ }], [{
151
+ 'type': 'TranslateY'
152
+ }]],
153
+ aug_num=1)
154
+ ]),
155
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
156
+ dict(
157
+ type='PackDetInputs',
158
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
159
+ 'scale_factor', 'flip', 'flip_direction',
160
+ 'homography_matrix'))
161
+ ]
162
+ unsup_pipeline = [
163
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
164
+ dict(type='LoadAnnotations', with_bbox=True),
165
+ dict(
166
+ type='MultiBranch',
167
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
168
+ unsup_teacher=[
169
+ dict(
170
+ type='RandomResize',
171
+ scale=[(1333, 400), (1333, 1200)],
172
+ keep_ratio=True),
173
+ dict(type='RandomFlip', prob=0.5),
174
+ dict(
175
+ type='PackDetInputs',
176
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
177
+ 'scale_factor', 'flip', 'flip_direction',
178
+ 'homography_matrix'))
179
+ ],
180
+ unsup_student=[
181
+ dict(
182
+ type='RandomResize',
183
+ scale=[(1333, 400), (1333, 1200)],
184
+ keep_ratio=True),
185
+ dict(type='RandomFlip', prob=0.5),
186
+ dict(
187
+ type='RandomOrder',
188
+ transforms=[
189
+ dict(
190
+ type='RandAugment',
191
+ aug_space=[[{
192
+ 'type': 'ColorTransform'
193
+ }], [{
194
+ 'type': 'AutoContrast'
195
+ }], [{
196
+ 'type': 'Equalize'
197
+ }], [{
198
+ 'type': 'Sharpness'
199
+ }], [{
200
+ 'type': 'Posterize'
201
+ }], [{
202
+ 'type': 'Solarize'
203
+ }], [{
204
+ 'type': 'Color'
205
+ }], [{
206
+ 'type': 'Contrast'
207
+ }], [{
208
+ 'type': 'Brightness'
209
+ }]],
210
+ aug_num=1),
211
+ dict(
212
+ type='RandAugment',
213
+ aug_space=[[{
214
+ 'type': 'Rotate'
215
+ }], [{
216
+ 'type': 'ShearX'
217
+ }], [{
218
+ 'type': 'ShearY'
219
+ }], [{
220
+ 'type': 'TranslateX'
221
+ }], [{
222
+ 'type': 'TranslateY'
223
+ }]],
224
+ aug_num=1)
225
+ ]),
226
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
227
+ dict(
228
+ type='PackDetInputs',
229
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
230
+ 'scale_factor', 'flip', 'flip_direction',
231
+ 'homography_matrix'))
232
+ ])
233
+ ]
234
+ test_pipeline = [
235
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
236
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
237
+ dict(
238
+ type='PackDetInputs',
239
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
240
+ 'scale_factor'))
241
+ ]
242
+ batch_size = 8
243
+ num_workers = 8
244
+ labeled_dataset = dict(
245
+ type='CocoDataset',
246
+ data_root='data/',
247
+ ann_file='coco_semi_anns/instances_train2017.1@10.json',
248
+ data_prefix=dict(img='coco/train2017/'),
249
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
250
+ pipeline=[
251
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
252
+ dict(type='LoadAnnotations', with_bbox=True),
253
+ dict(
254
+ type='RandomResize',
255
+ scale=[(1333, 400), (1333, 1200)],
256
+ keep_ratio=True),
257
+ dict(type='RandomFlip', prob=0.5),
258
+ dict(
259
+ type='RandAugment',
260
+ aug_space=[[{
261
+ 'type': 'ColorTransform'
262
+ }], [{
263
+ 'type': 'AutoContrast'
264
+ }], [{
265
+ 'type': 'Equalize'
266
+ }], [{
267
+ 'type': 'Sharpness'
268
+ }], [{
269
+ 'type': 'Posterize'
270
+ }], [{
271
+ 'type': 'Solarize'
272
+ }], [{
273
+ 'type': 'Color'
274
+ }], [{
275
+ 'type': 'Contrast'
276
+ }], [{
277
+ 'type': 'Brightness'
278
+ }]],
279
+ aug_num=1),
280
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
281
+ dict(
282
+ type='MultiBranch',
283
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
284
+ sup=dict(type='PackDetInputs'))
285
+ ])
286
+ unlabeled_dataset = dict(
287
+ type='CocoDataset',
288
+ data_root='data/',
289
+ ann_file='coco_semi_anns/instances_train2017.1@10-unlabeled.json',
290
+ data_prefix=dict(img='coco/train2017/'),
291
+ filter_cfg=dict(filter_empty_gt=False),
292
+ pipeline=[
293
+ dict(type='LoadImageFromFile', file_client_args=dict(backend='disk')),
294
+ dict(type='LoadAnnotations', with_bbox=True),
295
+ dict(
296
+ type='MultiBranch',
297
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
298
+ unsup_teacher=[
299
+ dict(
300
+ type='RandomResize',
301
+ scale=[(1333, 400), (1333, 1200)],
302
+ keep_ratio=True),
303
+ dict(type='RandomFlip', prob=0.5),
304
+ dict(
305
+ type='PackDetInputs',
306
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
307
+ 'scale_factor', 'flip', 'flip_direction',
308
+ 'homography_matrix'))
309
+ ],
310
+ unsup_student=[
311
+ dict(
312
+ type='RandomResize',
313
+ scale=[(1333, 400), (1333, 1200)],
314
+ keep_ratio=True),
315
+ dict(type='RandomFlip', prob=0.5),
316
+ dict(
317
+ type='RandomOrder',
318
+ transforms=[
319
+ dict(
320
+ type='RandAugment',
321
+ aug_space=[[{
322
+ 'type': 'ColorTransform'
323
+ }], [{
324
+ 'type': 'AutoContrast'
325
+ }], [{
326
+ 'type': 'Equalize'
327
+ }], [{
328
+ 'type': 'Sharpness'
329
+ }], [{
330
+ 'type': 'Posterize'
331
+ }], [{
332
+ 'type': 'Solarize'
333
+ }], [{
334
+ 'type': 'Color'
335
+ }], [{
336
+ 'type': 'Contrast'
337
+ }], [{
338
+ 'type': 'Brightness'
339
+ }]],
340
+ aug_num=1),
341
+ dict(
342
+ type='RandAugment',
343
+ aug_space=[[{
344
+ 'type': 'Rotate'
345
+ }], [{
346
+ 'type': 'ShearX'
347
+ }], [{
348
+ 'type': 'ShearY'
349
+ }], [{
350
+ 'type': 'TranslateX'
351
+ }], [{
352
+ 'type': 'TranslateY'
353
+ }]],
354
+ aug_num=1)
355
+ ]),
356
+ dict(type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
357
+ dict(
358
+ type='PackDetInputs',
359
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
360
+ 'scale_factor', 'flip', 'flip_direction',
361
+ 'homography_matrix'))
362
+ ])
363
+ ])
364
+ train_dataloader = dict(
365
+ batch_size=5,
366
+ num_workers=5,
367
+ persistent_workers=True,
368
+ sampler=dict(
369
+ type='GroupMultiSourceSampler', batch_size=5, source_ratio=[1, 4]),
370
+ dataset=dict(
371
+ type='ConcatDataset',
372
+ datasets=[
373
+ dict(
374
+ type='CocoDataset',
375
+ data_root='data/',
376
+ ann_file='coco_semi_anns/instances_train2017.1@10.json',
377
+ data_prefix=dict(img='coco/train2017/'),
378
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
379
+ pipeline=[
380
+ dict(
381
+ type='LoadImageFromFile',
382
+ file_client_args=dict(backend='disk')),
383
+ dict(type='LoadAnnotations', with_bbox=True),
384
+ dict(
385
+ type='RandomResize',
386
+ scale=[(1333, 400), (1333, 1200)],
387
+ keep_ratio=True),
388
+ dict(type='RandomFlip', prob=0.5),
389
+ dict(
390
+ type='RandAugment',
391
+ aug_space=[[{
392
+ 'type': 'ColorTransform'
393
+ }], [{
394
+ 'type': 'AutoContrast'
395
+ }], [{
396
+ 'type': 'Equalize'
397
+ }], [{
398
+ 'type': 'Sharpness'
399
+ }], [{
400
+ 'type': 'Posterize'
401
+ }], [{
402
+ 'type': 'Solarize'
403
+ }], [{
404
+ 'type': 'Color'
405
+ }], [{
406
+ 'type': 'Contrast'
407
+ }], [{
408
+ 'type': 'Brightness'
409
+ }]],
410
+ aug_num=1),
411
+ dict(
412
+ type='FilterAnnotations', min_gt_bbox_wh=(0.01, 0.01)),
413
+ dict(
414
+ type='MultiBranch',
415
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
416
+ sup=dict(type='PackDetInputs'))
417
+ ]),
418
+ dict(
419
+ type='CocoDataset',
420
+ data_root='data/',
421
+ ann_file=
422
+ 'coco_semi_anns/instances_train2017.1@10-unlabeled.json',
423
+ data_prefix=dict(img='coco/train2017/'),
424
+ filter_cfg=dict(filter_empty_gt=False),
425
+ pipeline=[
426
+ dict(
427
+ type='LoadImageFromFile',
428
+ file_client_args=dict(backend='disk')),
429
+ dict(type='LoadAnnotations', with_bbox=True),
430
+ dict(
431
+ type='MultiBranch',
432
+ branch_field=['sup', 'unsup_teacher', 'unsup_student'],
433
+ unsup_teacher=[
434
+ dict(
435
+ type='RandomResize',
436
+ scale=[(1333, 400), (1333, 1200)],
437
+ keep_ratio=True),
438
+ dict(type='RandomFlip', prob=0.5),
439
+ dict(
440
+ type='PackDetInputs',
441
+ meta_keys=('img_id', 'img_path', 'ori_shape',
442
+ 'img_shape', 'scale_factor', 'flip',
443
+ 'flip_direction',
444
+ 'homography_matrix'))
445
+ ],
446
+ unsup_student=[
447
+ dict(
448
+ type='RandomResize',
449
+ scale=[(1333, 400), (1333, 1200)],
450
+ keep_ratio=True),
451
+ dict(type='RandomFlip', prob=0.5),
452
+ dict(
453
+ type='RandomOrder',
454
+ transforms=[
455
+ dict(
456
+ type='RandAugment',
457
+ aug_space=[[{
458
+ 'type': 'ColorTransform'
459
+ }], [{
460
+ 'type': 'AutoContrast'
461
+ }], [{
462
+ 'type': 'Equalize'
463
+ }], [{
464
+ 'type': 'Sharpness'
465
+ }], [{
466
+ 'type': 'Posterize'
467
+ }], [{
468
+ 'type': 'Solarize'
469
+ }], [{
470
+ 'type': 'Color'
471
+ }], [{
472
+ 'type': 'Contrast'
473
+ }], [{
474
+ 'type': 'Brightness'
475
+ }]],
476
+ aug_num=1),
477
+ dict(
478
+ type='RandAugment',
479
+ aug_space=[[{
480
+ 'type': 'Rotate'
481
+ }], [{
482
+ 'type': 'ShearX'
483
+ }], [{
484
+ 'type': 'ShearY'
485
+ }], [{
486
+ 'type': 'TranslateX'
487
+ }], [{
488
+ 'type': 'TranslateY'
489
+ }]],
490
+ aug_num=1)
491
+ ]),
492
+ dict(
493
+ type='FilterAnnotations',
494
+ min_gt_bbox_wh=(0.01, 0.01)),
495
+ dict(
496
+ type='PackDetInputs',
497
+ meta_keys=('img_id', 'img_path', 'ori_shape',
498
+ 'img_shape', 'scale_factor', 'flip',
499
+ 'flip_direction',
500
+ 'homography_matrix'))
501
+ ])
502
+ ])
503
+ ]))
504
+ val_dataloader = dict(
505
+ batch_size=1,
506
+ num_workers=2,
507
+ persistent_workers=True,
508
+ drop_last=False,
509
+ sampler=dict(type='DefaultSampler', shuffle=False),
510
+ dataset=dict(
511
+ type='CocoDataset',
512
+ data_root='data/coco/',
513
+ ann_file='annotations/instances_val2017.json',
514
+ data_prefix=dict(img='val2017/'),
515
+ test_mode=True,
516
+ pipeline=[
517
+ dict(
518
+ type='LoadImageFromFile',
519
+ file_client_args=dict(backend='disk')),
520
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
521
+ dict(
522
+ type='PackDetInputs',
523
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
524
+ 'scale_factor'))
525
+ ]))
526
+ test_dataloader = dict(
527
+ batch_size=1,
528
+ num_workers=2,
529
+ persistent_workers=True,
530
+ drop_last=False,
531
+ sampler=dict(type='DefaultSampler', shuffle=False),
532
+ dataset=dict(
533
+ type='CocoDataset',
534
+ data_root='data/coco/',
535
+ ann_file='annotations/instances_val2017.json',
536
+ data_prefix=dict(img='val2017/'),
537
+ test_mode=True,
538
+ pipeline=[
539
+ dict(
540
+ type='LoadImageFromFile',
541
+ file_client_args=dict(backend='disk')),
542
+ dict(type='Resize', scale=(1333, 800), keep_ratio=True),
543
+ dict(
544
+ type='PackDetInputs',
545
+ meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
546
+ 'scale_factor'))
547
+ ]))
548
+ val_evaluator = dict(
549
+ type='CocoMetric',
550
+ ann_file='data/coco/annotations/instances_val2017.json',
551
+ metric='bbox',
552
+ format_only=False)
553
+ test_evaluator = dict(
554
+ type='CocoMetric',
555
+ ann_file='data/coco/annotations/instances_val2017.json',
556
+ metric='bbox',
557
+ format_only=False)
558
+ detector = dict(
559
+ type='DINO',
560
+ num_queries=900,
561
+ with_box_refine=True,
562
+ as_two_stage=True,
563
+ data_preprocessor=dict(
564
+ type='DetDataPreprocessor',
565
+ mean=[123.675, 116.28, 103.53],
566
+ std=[58.395, 57.12, 57.375],
567
+ bgr_to_rgb=True,
568
+ pad_size_divisor=1),
569
+ backbone=dict(
570
+ type='ResNet',
571
+ depth=50,
572
+ num_stages=4,
573
+ out_indices=(1, 2, 3),
574
+ frozen_stages=1,
575
+ norm_cfg=dict(type='BN', requires_grad=False),
576
+ norm_eval=True,
577
+ style='pytorch',
578
+ init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
579
+ neck=dict(
580
+ type='ChannelMapper',
581
+ in_channels=[512, 1024, 2048],
582
+ kernel_size=1,
583
+ out_channels=256,
584
+ act_cfg=None,
585
+ norm_cfg=dict(type='GN', num_groups=32),
586
+ num_outs=4),
587
+ encoder=dict(
588
+ num_layers=6,
589
+ layer_cfg=dict(
590
+ self_attn_cfg=dict(embed_dims=256, num_levels=4, dropout=0.0),
591
+ ffn_cfg=dict(
592
+ embed_dims=256, feedforward_channels=2048, ffn_drop=0.0))),
593
+ decoder=dict(
594
+ num_layers=6,
595
+ return_intermediate=True,
596
+ layer_cfg=dict(
597
+ self_attn_cfg=dict(embed_dims=256, num_heads=8, dropout=0.0),
598
+ cross_attn_cfg=dict(embed_dims=256, num_levels=4, dropout=0.0),
599
+ ffn_cfg=dict(
600
+ embed_dims=256, feedforward_channels=2048, ffn_drop=0.0)),
601
+ post_norm_cfg=None),
602
+ positional_encoding=dict(
603
+ num_feats=128, normalize=True, offset=0.0, temperature=20),
604
+ bbox_head=dict(
605
+ type='DINOHead',
606
+ num_classes=80,
607
+ sync_cls_avg_factor=True,
608
+ loss_cls=dict(
609
+ type='FocalLoss',
610
+ use_sigmoid=True,
611
+ gamma=2.0,
612
+ alpha=0.25,
613
+ loss_weight=1.0),
614
+ loss_bbox=dict(type='L1Loss', loss_weight=5.0),
615
+ loss_iou=dict(type='GIoULoss', loss_weight=2.0)),
616
+ dn_cfg=dict(
617
+ label_noise_scale=0.5,
618
+ box_noise_scale=1.0,
619
+ group_cfg=dict(dynamic=True, num_groups=None, num_dn_queries=100)),
620
+ train_cfg=dict(
621
+ assigner=dict(
622
+ type='HungarianAssigner',
623
+ match_costs=[
624
+ dict(type='FocalLossCost', weight=2.0),
625
+ dict(type='BBoxL1Cost', weight=5.0, box_format='xywh'),
626
+ dict(type='IoUCost', iou_mode='giou', weight=2.0)
627
+ ])),
628
+ test_cfg=dict(max_per_img=300))
629
+ work_dir = '/mnt/petrelfs/chenzeming/mixpl/mixpl_dino-4scale_r50_90k_coco-s1-p10.py'
630
+ model = dict(
631
+ type='MixPL',
632
+ detector=dict(
633
+ type='DINO',
634
+ num_queries=900,
635
+ with_box_refine=True,
636
+ as_two_stage=True,
637
+ data_preprocessor=dict(
638
+ type='DetDataPreprocessor',
639
+ mean=[123.675, 116.28, 103.53],
640
+ std=[58.395, 57.12, 57.375],
641
+ bgr_to_rgb=True,
642
+ pad_size_divisor=1),
643
+ backbone=dict(
644
+ type='ResNet',
645
+ depth=50,
646
+ num_stages=4,
647
+ out_indices=(1, 2, 3),
648
+ frozen_stages=1,
649
+ norm_cfg=dict(type='BN', requires_grad=False),
650
+ norm_eval=True,
651
+ style='pytorch',
652
+ init_cfg=dict(
653
+ type='Pretrained', checkpoint='torchvision://resnet50')),
654
+ neck=dict(
655
+ type='ChannelMapper',
656
+ in_channels=[512, 1024, 2048],
657
+ kernel_size=1,
658
+ out_channels=256,
659
+ act_cfg=None,
660
+ norm_cfg=dict(type='GN', num_groups=32),
661
+ num_outs=4),
662
+ encoder=dict(
663
+ num_layers=6,
664
+ layer_cfg=dict(
665
+ self_attn_cfg=dict(embed_dims=256, num_levels=4, dropout=0.0),
666
+ ffn_cfg=dict(
667
+ embed_dims=256, feedforward_channels=2048, ffn_drop=0.0))),
668
+ decoder=dict(
669
+ num_layers=6,
670
+ return_intermediate=True,
671
+ layer_cfg=dict(
672
+ self_attn_cfg=dict(embed_dims=256, num_heads=8, dropout=0.0),
673
+ cross_attn_cfg=dict(embed_dims=256, num_levels=4, dropout=0.0),
674
+ ffn_cfg=dict(
675
+ embed_dims=256, feedforward_channels=2048, ffn_drop=0.0)),
676
+ post_norm_cfg=None),
677
+ positional_encoding=dict(
678
+ num_feats=128, normalize=True, offset=0.0, temperature=20),
679
+ bbox_head=dict(
680
+ type='DINOHead',
681
+ num_classes=80,
682
+ sync_cls_avg_factor=True,
683
+ loss_cls=dict(
684
+ type='FocalLoss',
685
+ use_sigmoid=True,
686
+ gamma=2.0,
687
+ alpha=0.25,
688
+ loss_weight=1.0),
689
+ loss_bbox=dict(type='L1Loss', loss_weight=5.0),
690
+ loss_iou=dict(type='GIoULoss', loss_weight=2.0)),
691
+ dn_cfg=dict(
692
+ label_noise_scale=0.5,
693
+ box_noise_scale=1.0,
694
+ group_cfg=dict(dynamic=True, num_groups=None, num_dn_queries=100)),
695
+ train_cfg=dict(
696
+ assigner=dict(
697
+ type='HungarianAssigner',
698
+ match_costs=[
699
+ dict(type='FocalLossCost', weight=2.0),
700
+ dict(type='BBoxL1Cost', weight=5.0, box_format='xywh'),
701
+ dict(type='IoUCost', iou_mode='giou', weight=2.0)
702
+ ])),
703
+ test_cfg=dict(max_per_img=300)),
704
+ data_preprocessor=dict(
705
+ type='MultiBranchDataPreprocessor',
706
+ data_preprocessor=dict(
707
+ type='DetDataPreprocessor',
708
+ mean=[123.675, 116.28, 103.53],
709
+ std=[58.395, 57.12, 57.375],
710
+ bgr_to_rgb=True,
711
+ pad_size_divisor=1)),
712
+ semi_train_cfg=dict(
713
+ least_num=1,
714
+ cache_size=8,
715
+ mixup=True,
716
+ mosaic=True,
717
+ mosaic_shape=[(400, 400), (800, 800)],
718
+ mosaic_weight=0.5,
719
+ erase=True,
720
+ erase_patches=(1, 20),
721
+ erase_ratio=(0, 0.1),
722
+ erase_thr=0.7,
723
+ cls_pseudo_thr=0.4,
724
+ freeze_teacher=True,
725
+ sup_weight=1.0,
726
+ unsup_weight=2.0,
727
+ min_pseudo_bbox_wh=(0.01, 0.01)),
728
+ semi_test_cfg=dict(predict_on='teacher'))
729
+ train_cfg = dict(type='IterBasedTrainLoop', max_iters=90000, val_interval=5000)
730
+ val_cfg = dict(type='TeacherStudentValLoop')
731
+ test_cfg = dict(type='TestLoop')
732
+ param_scheduler = [
733
+ dict(
734
+ type='LinearLR', start_factor=0.001, by_epoch=False, begin=0, end=500)
735
+ ]
736
+ optim_wrapper = dict(
737
+ type='OptimWrapper',
738
+ optimizer=dict(type='AdamW', lr=0.0001, weight_decay=0.0001),
739
+ clip_grad=dict(max_norm=0.1, norm_type=2),
740
+ paramwise_cfg=dict(custom_keys=dict(backbone=dict(lr_mult=0.1))))
741
+ custom_hooks = [dict(type='AnnealMeanTeacherHook', momentum=0.0002, gamma=4)]
742
+ launcher = 'slurm'