You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/tutorials/config.md
+81-75
Original file line number
Diff line number
Diff line change
@@ -71,8 +71,8 @@ The `train_cfg` and `test_cfg` are deprecated in config file, please specify the
71
71
```python
72
72
# deprecated
73
73
model =dict(
74
-
type=...,
75
-
...
74
+
type=...,
75
+
...
76
76
)
77
77
train_cfg=dict(...)
78
78
test_cfg=dict(...)
@@ -83,10 +83,10 @@ The migration example is as below.
83
83
```python
84
84
# recommended
85
85
model =dict(
86
-
type=...,
87
-
...
88
-
train_cfg=dict(...),
89
-
test_cfg=dict(...),
86
+
type=...,
87
+
...
88
+
train_cfg=dict(...),
89
+
test_cfg=dict(...),
90
90
)
91
91
```
92
92
@@ -109,8 +109,8 @@ model = dict(
109
109
type='BN', # Type of norm layer, usually it is BN or GN
110
110
requires_grad=True), # Whether to train the gamma and beta in BN
111
111
norm_eval=True, # Whether to freeze the statistics in BN
112
-
style='pytorch',# The style of backbone, 'pytorch' means that stride 2 layers are in 3x3 conv, 'caffe' means stride 2 layers are in 1x1 convs.
113
-
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), # The ImageNet pretrained backbone to be loaded
112
+
style='pytorch',# The style of backbone, 'pytorch' means that stride 2 layers are in 3x3 conv, 'caffe' means stride 2 layers are in 1x1 convs.
113
+
init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), # The ImageNet pretrained backbone to be loaded
114
114
neck=dict(
115
115
type='FPN', # The neck of detector is FPN. We also support 'NASFPN', 'PAFPN', etc. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/models/necks/fpn.py#L10 for more details.
116
116
in_channels=[256, 512, 1024, 2048], # The input channels, this is consistent with the output channels of backbone
@@ -182,70 +182,70 @@ model = dict(
182
182
type='CrossEntropyLoss', # Type of loss used for segmentation
183
183
use_mask=True, # Whether to only train the mask in the correct class.
184
184
loss_weight=1.0)))) # Loss weight of mask branch.
185
-
train_cfg =dict( # Config of training hyperparameters for rpn and rcnn
186
-
rpn=dict( # Training config of rpn
187
-
assigner=dict( # Config of assigner
188
-
type='MaxIoUAssigner', # Type of assigner, MaxIoUAssigner is used for many common detectors. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10 for more details.
189
-
pos_iou_thr=0.7, # IoU >= threshold 0.7 will be taken as positive samples
190
-
neg_iou_thr=0.3, # IoU < threshold 0.3 will be taken as negative samples
191
-
min_pos_iou=0.3, # The minimal IoU threshold to take boxes as positive samples
192
-
match_low_quality=True, # Whether to match the boxes under low quality (see API doc for more details).
193
-
ignore_iof_thr=-1), # IoF threshold for ignoring bboxes
194
-
sampler=dict( # Config of positive/negative sampler
195
-
type='RandomSampler', # Type of sampler, PseudoSampler and other samplers are also supported. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8 for implementation details.
196
-
num=256, # Number of samples
197
-
pos_fraction=0.5, # The ratio of positive samples in the total samples.
198
-
neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples.
199
-
add_gt_as_proposals=False), # Whether add GT as proposals after sampling.
200
-
allowed_border=-1, # The border allowed after padding for valid anchors.
201
-
pos_weight=-1, # The weight of positive samples during training.
202
-
debug=False), # Whether to set the debug mode
203
-
rpn_proposal=dict( # The config to generate proposals during training
204
-
nms_across_levels=False, # Whether to do NMS for boxes across levels. Only work in `GARPNHead`, naive rpn does not support do nms cross levels.
205
-
nms_pre=2000, # The number of boxes before NMS
206
-
nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`.
207
-
max_per_img=1000, # The number of boxes to be kept after NMS.
208
-
nms=dict( # Config of NMS
209
-
type='nms', # Type of NMS
210
-
iou_threshold=0.7# NMS threshold
211
-
),
212
-
min_bbox_size=0), # The allowed minimal box size
213
-
rcnn=dict( # The config for the roi heads.
214
-
assigner=dict( # Config of assigner for second stage, this is different for that in rpn
215
-
type='MaxIoUAssigner', # Type of assigner, MaxIoUAssigner is used for all roi_heads for now. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10 for more details.
216
-
pos_iou_thr=0.5, # IoU >= threshold 0.5 will be taken as positive samples
217
-
neg_iou_thr=0.5, # IoU < threshold 0.5 will be taken as negative samples
218
-
min_pos_iou=0.5, # The minimal IoU threshold to take boxes as positive samples
219
-
match_low_quality=False, # Whether to match the boxes under low quality (see API doc for more details).
220
-
ignore_iof_thr=-1), # IoF threshold for ignoring bboxes
221
-
sampler=dict(
222
-
type='RandomSampler', # Type of sampler, PseudoSampler and other samplers are also supported. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8 for implementation details.
223
-
num=512, # Number of samples
224
-
pos_fraction=0.25, # The ratio of positive samples in the total samples.
225
-
neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples.
226
-
add_gt_as_proposals=True
227
-
), # Whether add GT as proposals after sampling.
228
-
mask_size=28, # Size of mask
229
-
pos_weight=-1, # The weight of positive samples during training.
230
-
debug=False)) # Whether to set the debug mode
231
-
test_cfg =dict( # Config for testing hyperparameters for rpn and rcnn
232
-
rpn=dict( # The config to generate proposals during testing
233
-
nms_across_levels=False, # Whether to do NMS for boxes across levels. Only work in `GARPNHead`, naive rpn does not support do nms cross levels.
234
-
nms_pre=1000, # The number of boxes before NMS
235
-
nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`.
236
-
max_per_img=1000, # The number of boxes to be kept after NMS.
237
-
nms=dict( # Config of NMS
238
-
type='nms', #Type of NMS
239
-
iou_threshold=0.7# NMS threshold
240
-
),
241
-
min_bbox_size=0), # The allowed minimal box size
242
-
rcnn=dict( # The config for the roi heads.
243
-
score_thr=0.05, # Threshold to filter out boxes
244
-
nms=dict( # Config of NMS in the second stage
245
-
type='nms', # Type of NMS
246
-
iou_thr=0.5), # NMS threshold
247
-
max_per_img=100, # Max number of detections of each image
248
-
mask_thr_binary=0.5)) # Threshold of mask prediction
185
+
train_cfg =dict( # Config of training hyperparameters for rpn and rcnn
186
+
rpn=dict( # Training config of rpn
187
+
assigner=dict( # Config of assigner
188
+
type='MaxIoUAssigner', # Type of assigner, MaxIoUAssigner is used for many common detectors. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10 for more details.
189
+
pos_iou_thr=0.7, # IoU >= threshold 0.7 will be taken as positive samples
190
+
neg_iou_thr=0.3, # IoU < threshold 0.3 will be taken as negative samples
191
+
min_pos_iou=0.3, # The minimal IoU threshold to take boxes as positive samples
192
+
match_low_quality=True, # Whether to match the boxes under low quality (see API doc for more details).
193
+
ignore_iof_thr=-1), # IoF threshold for ignoring bboxes
194
+
sampler=dict( # Config of positive/negative sampler
195
+
type='RandomSampler', # Type of sampler, PseudoSampler and other samplers are also supported. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8 for implementation details.
196
+
num=256, # Number of samples
197
+
pos_fraction=0.5, # The ratio of positive samples in the total samples.
198
+
neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples.
199
+
add_gt_as_proposals=False), # Whether add GT as proposals after sampling.
200
+
allowed_border=-1, # The border allowed after padding for valid anchors.
201
+
pos_weight=-1, # The weight of positive samples during training.
202
+
debug=False), # Whether to set the debug mode
203
+
rpn_proposal=dict( # The config to generate proposals during training
204
+
nms_across_levels=False, # Whether to do NMS for boxes across levels. Only work in `GARPNHead`, naive rpn does not support do nms cross levels.
205
+
nms_pre=2000, # The number of boxes before NMS
206
+
nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`.
207
+
max_per_img=1000, # The number of boxes to be kept after NMS.
208
+
nms=dict( # Config of NMS
209
+
type='nms', # Type of NMS
210
+
iou_threshold=0.7# NMS threshold
211
+
),
212
+
min_bbox_size=0), # The allowed minimal box size
213
+
rcnn=dict( # The config for the roi heads.
214
+
assigner=dict( # Config of assigner for second stage, this is different for that in rpn
215
+
type='MaxIoUAssigner', # Type of assigner, MaxIoUAssigner is used for all roi_heads for now. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10 for more details.
216
+
pos_iou_thr=0.5, # IoU >= threshold 0.5 will be taken as positive samples
217
+
neg_iou_thr=0.5, # IoU < threshold 0.5 will be taken as negative samples
218
+
min_pos_iou=0.5, # The minimal IoU threshold to take boxes as positive samples
219
+
match_low_quality=False, # Whether to match the boxes under low quality (see API doc for more details).
220
+
ignore_iof_thr=-1), # IoF threshold for ignoring bboxes
221
+
sampler=dict(
222
+
type='RandomSampler', # Type of sampler, PseudoSampler and other samplers are also supported. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8 for implementation details.
223
+
num=512, # Number of samples
224
+
pos_fraction=0.25, # The ratio of positive samples in the total samples.
225
+
neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples.
226
+
add_gt_as_proposals=True
227
+
), # Whether add GT as proposals after sampling.
228
+
mask_size=28, # Size of mask
229
+
pos_weight=-1, # The weight of positive samples during training.
230
+
debug=False)) # Whether to set the debug mode
231
+
test_cfg =dict( # Config for testing hyperparameters for rpn and rcnn
232
+
rpn=dict( # The config to generate proposals during testing
233
+
nms_across_levels=False, # Whether to do NMS for boxes across levels. Only work in `GARPNHead`, naive rpn does not support do nms cross levels.
234
+
nms_pre=1000, # The number of boxes before NMS
235
+
nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`.
236
+
max_per_img=1000, # The number of boxes to be kept after NMS.
237
+
nms=dict( # Config of NMS
238
+
type='nms', #Type of NMS
239
+
iou_threshold=0.7# NMS threshold
240
+
),
241
+
min_bbox_size=0), # The allowed minimal box size
242
+
rcnn=dict( # The config for the roi heads.
243
+
score_thr=0.05, # Threshold to filter out boxes
244
+
nms=dict( # Config of NMS in the second stage
245
+
type='nms', # Type of NMS
246
+
iou_thr=0.5), # NMS threshold
247
+
max_per_img=100, # Max number of detections of each image
248
+
mask_thr_binary=0.5)) # Threshold of mask prediction
249
249
dataset_type ='CocoDataset'# Dataset type, this will be used to define the dataset
250
250
data_root ='data/coco/'# Root path of data
251
251
img_norm_cfg =dict( # Image normalization config to normalize the input images
@@ -381,7 +381,7 @@ data = dict(
381
381
])
382
382
],
383
383
samples_per_gpu=2# Batch size of a single GPU used in testing
384
-
))
384
+
))
385
385
evaluation =dict( # The config to build the evaluation hook, refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/evaluation/eval_hooks.py#L7 for more details.
386
386
interval=1, # Evaluation interval
387
387
metric=['bbox', 'segm']) # Metrics used during evaluation
@@ -407,9 +407,15 @@ checkpoint_config = dict( # Config to set the checkpoint hook, Refer to https:/
407
407
log_config =dict( # config to register logger hook
408
408
interval=50, # Interval to print the log
409
409
hooks=[
410
-
# dict(type='TensorboardLoggerHook') # The Tensorboard logger is also supported
dict(type='MMDetWandbHook', by_epoch=False, # The Wandb logger is also supported, It requires `wandb` to be installed.
413
+
init_kwargs={'entity': "OpenMMLab", # The entity used to log on Wandb
414
+
'project': "MMDet", # Project name in WandB
415
+
'config': cfg_dict}), # Check https://docs.wandb.ai/ref/python/init for more init arguments.
416
+
# MMDetWandbHook is mmdet implementation of WandbLoggerHook. ClearMLLoggerHook, DvcliveLoggerHook, MlflowLoggerHook, NeptuneLoggerHook, PaviLoggerHook, SegmindLoggerHook are also supported based on MMCV implementation.
412
417
]) # The logger used to record the training process.
418
+
413
419
dist_params =dict(backend='nccl') # Parameters to setup distributed training, the port can also be set.
414
420
log_level ='INFO'# The level of logging.
415
421
load_from =None# load models as a pre-trained model from a given path. This will not resume training.
0 commit comments