bodangjozinski commited on
Commit
5a93069
·
verified ·
1 Parent(s): 32e9963

Upload mmdetection-config.py

Browse files
Files changed (1) hide show
  1. mmdetection-config.py +235 -0
mmdetection-config.py ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ num_batch_size = 4
2
+ num_epochs = 15
3
+ num_frozen_stages = 2
4
+
5
+ auto_scale_lr = dict(base_batch_size=2, enable=False)
6
+ backend_args = None
7
+ data_root = 'C:/vs_code_workspaces/mmdetection/mmdetection/data/ins/v9'
8
+ dataset_type = 'CocoDataset'
9
+ default_hooks = dict(
10
+ checkpoint=dict(interval=1, type='CheckpointHook'),
11
+ logger=dict(interval=50, type='LoggerHook'),
12
+ param_scheduler=dict(type='ParamSchedulerHook'),
13
+ sampler_seed=dict(type='DistSamplerSeedHook'),
14
+ timer=dict(type='IterTimerHook'),
15
+ visualization=dict(type='DetVisualizationHook'))
16
+ default_scope = 'mmdet'
17
+ env_cfg = dict(cudnn_benchmark=False, dist_cfg=dict(backend='nccl'), mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
18
+ launcher = 'none'
19
+ load_from = 'C:/vs_code_workspaces/mmdetection/mmdetection/ins_development/resources/add300_frozen2/epoch_9.pth'
20
+ log_level = 'INFO'
21
+ log_processor = dict(by_epoch=True, type='LogProcessor', window_size=50)
22
+ metainfo = dict(classes=('waste', ), palette=[ (220, 20, 60, ),])
23
+ model = dict(
24
+ backbone=dict(
25
+ depth=101,
26
+ frozen_stages=num_frozen_stages,
27
+ init_cfg=dict(checkpoint='C:/Users/INS/.cache/torch/hub/checkpoints/resnet101-63fe2227.pth', type='Pretrained'),
28
+ norm_cfg=dict(requires_grad=True, type='BN'),
29
+ norm_eval=True,
30
+ num_stages=4,
31
+ out_indices=(0, 1, 2, 3, ),
32
+ style='pytorch',
33
+ type='ResNet'),
34
+ data_preprocessor=dict(
35
+ bgr_to_rgb=True,
36
+ mean=[123.675, 116.28, 103.53, ],
37
+ pad_size_divisor=32,
38
+ std=[58.395, 57.12, 57.375, ],
39
+ type='DetDataPreprocessor'),
40
+ neck=dict(in_channels=[256, 512, 1024, 2048, ],
41
+ num_outs=5,
42
+ out_channels=256,
43
+ type='FPN'),
44
+ roi_head=dict(
45
+ bbox_head=dict(
46
+ bbox_coder=dict(
47
+ target_means=[0.0, 0.0, 0.0, 0.0,],
48
+ target_stds=[0.1, 0.1, 0.2, 0.2,],
49
+ type='DeltaXYWHBBoxCoder'),
50
+ fc_out_channels=1024,
51
+ in_channels=256,
52
+ loss_bbox=dict(loss_weight=1.0, type='L1Loss'),
53
+ loss_cls=dict(
54
+ loss_weight=1.0, type='CrossEntropyLoss', use_sigmoid=False),
55
+ num_classes=1,
56
+ reg_class_agnostic=False,
57
+ roi_feat_size=7,
58
+ type='Shared2FCBBoxHead'),
59
+ bbox_roi_extractor=dict(
60
+ featmap_strides=[4, 8, 16, 32, ],
61
+ out_channels=256,
62
+ roi_layer=dict(output_size=7, sampling_ratio=0, type='RoIAlign'),
63
+ type='SingleRoIExtractor'),
64
+ type='StandardRoIHead'),
65
+ rpn_head=dict(
66
+ anchor_generator=dict(
67
+ ratios=[0.5, 1.0, 2.0, ],
68
+ scales=[8,],
69
+ strides=[4, 8, 16, 32, 64, ],
70
+ type='AnchorGenerator'),
71
+ bbox_coder=dict(
72
+ target_means=[0.0, 0.0, 0.0, 0.0, ],
73
+ target_stds=[1.0, 1.0, 1.0, 1.0, ],
74
+ type='DeltaXYWHBBoxCoder'),
75
+ feat_channels=256,
76
+ in_channels=256,
77
+ loss_bbox=dict(loss_weight=1.0, type='L1Loss'),
78
+ loss_cls=dict(loss_weight=1.0, type='CrossEntropyLoss', use_sigmoid=True),
79
+ type='RPNHead'),
80
+ test_cfg=dict(
81
+ rcnn=dict(
82
+ max_per_img=100,
83
+ nms=dict(iou_threshold=0.5, type='nms'),
84
+ score_thr=0.05),
85
+ rpn=dict(
86
+ max_per_img=1000,
87
+ min_bbox_size=0,
88
+ nms=dict(iou_threshold=0.7, type='nms'),
89
+ nms_pre=1000)),
90
+ train_cfg=dict(
91
+ rcnn=dict(
92
+ assigner=dict(
93
+ ignore_iof_thr=-1,
94
+ match_low_quality=False,
95
+ min_pos_iou=0.5,
96
+ neg_iou_thr=0.5,
97
+ pos_iou_thr=0.5,
98
+ type='MaxIoUAssigner'),
99
+ debug=False,
100
+ pos_weight=-1,
101
+ sampler=dict(
102
+ add_gt_as_proposals=True,
103
+ neg_pos_ub=-1,
104
+ num=512,
105
+ pos_fraction=0.25,
106
+ type='RandomSampler')),
107
+ rpn=dict(
108
+ allowed_border=-1,
109
+ assigner=dict(
110
+ ignore_iof_thr=-1,
111
+ match_low_quality=True,
112
+ min_pos_iou=0.3,
113
+ neg_iou_thr=0.3,
114
+ pos_iou_thr=0.7,
115
+ type='MaxIoUAssigner'),
116
+ debug=False,
117
+ pos_weight=-1,
118
+ sampler=dict(
119
+ add_gt_as_proposals=False,
120
+ neg_pos_ub=-1,
121
+ num=256,
122
+ pos_fraction=0.5,
123
+ type='RandomSampler')),
124
+ rpn_proposal=dict(
125
+ max_per_img=1000,
126
+ min_bbox_size=0,
127
+ nms=dict(iou_threshold=0.7, type='nms'),
128
+ nms_pre=2000)),
129
+ type='FasterRCNN')
130
+ optim_wrapper = dict(
131
+ optimizer=dict(lr=0.02, momentum=0.9, type='SGD', weight_decay=0.0001),
132
+ type='OptimWrapper')
133
+ param_scheduler = [
134
+ dict(begin=0, by_epoch=False, end=500, start_factor=0.001, type='LinearLR'),
135
+ dict(begin=0, by_epoch=True, end=12, gamma=0.1, milestones=[8, 11, ], type='MultiStepLR'),
136
+ ]
137
+ resume = False
138
+ test_cfg = dict(type='TestLoop')
139
+ test_dataloader = dict(
140
+ batch_size=num_batch_size,
141
+ dataset=dict(
142
+ ann_file='test/annotations_coco.json',
143
+ backend_args=None,
144
+ data_prefix=dict(img='test/'),
145
+ data_root=data_root,
146
+ metainfo=dict(classes=('waste', ), palette=[(220, 20, 60, ), ]),
147
+ pipeline=[
148
+ dict(backend_args=None, type='LoadImageFromFile'),
149
+ dict(keep_ratio=True, scale=(1280, 1280, ), type='Resize'),
150
+ dict(type='LoadAnnotations', with_bbox=True),
151
+ dict(meta_keys=( 'img_id', 'img_path', 'ori_shape', 'img_shape', 'scale_factor',), type='PackDetInputs'),
152
+ ],
153
+ test_mode=True,
154
+ type='CocoDataset'),
155
+ drop_last=False,
156
+ num_workers=2,
157
+ persistent_workers=True,
158
+ sampler=dict(shuffle=False, type='DefaultSampler'))
159
+ test_evaluator = dict(
160
+ ann_file='data/ins_annotated_v9/test/annotations_coco.json',
161
+ backend_args=None,
162
+ format_only=False,
163
+ metric='bbox',
164
+ type='CocoMetric')
165
+ test_pipeline = [
166
+ dict(backend_args=None, type='LoadImageFromFile'),
167
+ dict(keep_ratio=True, scale=(1280, 1280,), type='Resize'),
168
+ dict(type='LoadAnnotations', with_bbox=True),
169
+ dict(meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'scale_factor',),type='PackDetInputs'),
170
+ ]
171
+ train_cfg = dict(max_epochs=num_epochs, type='EpochBasedTrainLoop', val_interval=1)
172
+ train_dataloader = dict(
173
+ batch_sampler=dict(type='AspectRatioBatchSampler'),
174
+ batch_size=num_batch_size,
175
+ dataset=dict(
176
+ ann_file='train/annotations_coco.json',
177
+ backend_args=None,
178
+ data_prefix=dict(img='train/'),
179
+ data_root=data_root,
180
+ filter_cfg=dict(filter_empty_gt=True, min_size=32),
181
+ metainfo=dict(classes=('waste', ), palette=[(220, 20, 60, ),]),
182
+ pipeline=[
183
+ dict(backend_args=None, type='LoadImageFromFile'),
184
+ dict(type='LoadAnnotations', with_bbox=True),
185
+ dict(keep_ratio=True, scale=(1280, 1280, ), type='Resize'),
186
+ dict(prob=0.5, type='RandomFlip'),
187
+ dict(type='PackDetInputs'),
188
+ ],
189
+ type='CocoDataset'),
190
+ num_workers=2,
191
+ persistent_workers=True,
192
+ sampler=dict(shuffle=True, type='DefaultSampler'))
193
+ train_pipeline = [
194
+ dict(backend_args=None, type='LoadImageFromFile'),
195
+ dict(type='LoadAnnotations', with_bbox=True),
196
+ dict(keep_ratio=True, scale=(1280, 1280, ), type='Resize'),
197
+ dict(prob=0.5, type='RandomFlip'),
198
+ dict(type='PackDetInputs'),
199
+ ]
200
+ val_cfg = dict(type='ValLoop')
201
+ val_dataloader = dict(
202
+ batch_size=num_batch_size,
203
+ dataset=dict(
204
+ ann_file='valid/annotations_coco.json',
205
+ backend_args=None,
206
+ data_prefix=dict(img='valid/'),
207
+ data_root=data_root,
208
+ metainfo=dict(classes=('waste', ), palette=[(220, 20, 60, ),]),
209
+ pipeline=[
210
+ dict(backend_args=None, type='LoadImageFromFile'),
211
+ dict(keep_ratio=True, scale=(1280, 1280,), type='Resize'),
212
+ dict(type='LoadAnnotations', with_bbox=True),
213
+ dict(meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'scale_factor', ),type='PackDetInputs'),
214
+ ],
215
+ test_mode=True,
216
+ type='CocoDataset'),
217
+ drop_last=False,
218
+ num_workers=2,
219
+ persistent_workers=True,
220
+ sampler=dict(shuffle=False, type='DefaultSampler'))
221
+ val_evaluator = dict(
222
+ ann_file='data/ins_annotated_v9/valid/annotations_coco.json',
223
+ backend_args=None,
224
+ format_only=False,
225
+ metric='bbox',
226
+ type='CocoMetric')
227
+ val_pipeline = [
228
+ dict(backend_args=None, type='LoadImageFromFile'),
229
+ dict(keep_ratio=True, scale=(1280, 1280, ), type='Resize'),
230
+ dict(type='LoadAnnotations', with_bbox=True),
231
+ dict(meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'scale_factor',), type='PackDetInputs'),
232
+ ]
233
+ vis_backends = [dict(type='LocalVisBackend'), ]
234
+ visualizer = dict(name='visualizer', type='DetLocalVisualizer', vis_backends=[dict(type='LocalVisBackend'), ])
235
+ work_dir = './ins_development/training/ins_annotated_v9/pretrained/add300/faster/2frozen/e9\\'