-
Notifications
You must be signed in to change notification settings - Fork 2
/
coco_human-vanilla_baseline-75epochs.py
153 lines (141 loc) · 4.69 KB
/
coco_human-vanilla_baseline-75epochs.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
_base_ = [
'../common/mstrain-poly_3x_coco_instance.py',
'../_base_/models/mask_rcnn_r50_fpn.py'
]
classes = ('person',)
# model settings
model = dict(roi_head=dict(
bbox_head=dict(num_classes=len(classes)),
mask_head=dict(num_classes=len(classes))
))
# dataset settings
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(1333, 800),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', **img_norm_cfg),
dict(type='Pad', size_divisor=32),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img']),
])
]
data_root = './data/'
data = dict(
samples_per_gpu=2,
workers_per_gpu=1,
train=dict(
dataset=dict(
ann_file=data_root + 'COCO2017/annotations/instances_train2017.json',
img_prefix=data_root + 'COCO2017/train2017/',
classes=classes,
),
classes=classes,
),
val=dict(
type='ConcatDataset',
datasets=[
dict(type='CocoDataset',
ann_file=data_root + 'COCO2017/annotations/instances_val2017.json',
img_prefix=data_root + 'COCO2017/val2017/',
classes=classes,
pipeline=test_pipeline,
),
dict(type='CocoDataset',
ann_file=data_root + 'OCHuman/ochuman_coco_format_val_range_0.00_1.00_full_labelled.json',
img_prefix=data_root + 'OCHuman/images/',
classes=classes,
pipeline=test_pipeline,
),
],
),
test=dict(
type='ConcatDataset',
datasets=[
dict(
type='CocoDataset',
ann_file=data_root + 'COCO2017/annotations/instances_val2017.json',
img_prefix=data_root + 'COCO2017/val2017/',
classes=classes,
test_mode=True,
pipeline=test_pipeline
),
dict(
type='CocoDataset',
ann_file=data_root + 'OCHuman/ochuman_coco_format_val_range_0.00_1.00.json',
img_prefix=data_root + 'OCHuman/images/',
classes=classes,
test_mode=True,
pipeline=test_pipeline,
),
dict(
type='CocoDataset',
ann_file=data_root + 'OCHuman/ochuman_coco_format_test_range_0.00_1.00.json',
img_prefix=data_root + 'OCHuman/images/',
classes=classes,
test_mode=True,
pipeline=test_pipeline,
),
dict(type='CocoDataset',
ann_file=data_root + 'COCO2017/annotations/instances_val_person2017.json',
img_prefix=data_root + 'COCO2017/val2017/',
classes=classes,
test_mode=True,
pipeline=test_pipeline,
),
dict(
type='CocoDataset',
ann_file=data_root + 'OCHuman/ochuman_coco_format_val_range_0.00_1.00_full_labelled.json',
img_prefix=data_root + 'OCHuman/images/',
classes=classes,
test_mode=True,
pipeline=test_pipeline,
),
dict(
type='CocoDataset',
ann_file=data_root + 'OCHuman/ochuman_coco_format_test_range_0.00_1.00_full_labelled.json',
img_prefix=data_root + 'OCHuman/images/',
classes=classes,
test_mode=True,
pipeline=test_pipeline
),
]
),
)
# optimizer from strong baseline
optimizer = dict( lr=0.0125 ) # for bs8 (2 x 4gpus). strong baseline's LR is 0.1 for bs64
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=0.067,
step=[22, 24]
)
runner = dict(type='EpochBasedRunner', max_epochs=25)
# 25 epochs, but 3x repeat dataset, equivalent to 75 epochs
evaluation = dict(
interval=1,
save_best='1_segm_mAP',
metric=['bbox', 'segm'],
)
checkpoint_config = dict(interval=1, max_keep_ckpts=3)
log_config = dict(
interval=20,
hooks=[
dict(type='TextLoggerHook'),
# dict(
# type='WandbLoggerHook',
# init_kwargs=dict(
# project='ocp',
# name='coco_human-75eps-baseline'
# ),
# out_suffix=('.log.json', '.log', '.py')
# )
]
)