diff --git a/docs/en/tutorials/config.md b/docs/en/tutorials/config.md index 9f7759a2079..8fd37dbae25 100644 --- a/docs/en/tutorials/config.md +++ b/docs/en/tutorials/config.md @@ -181,71 +181,72 @@ model = dict( loss_mask=dict( # Config of loss function for the mask branch. type='CrossEntropyLoss', # Type of loss used for segmentation use_mask=True, # Whether to only train the mask in the correct class. - loss_weight=1.0)))) # Loss weight of mask branch. -train_cfg = dict( # Config of training hyperparameters for rpn and rcnn - rpn=dict( # Training config of rpn - assigner=dict( # Config of assigner - 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. - pos_iou_thr=0.7, # IoU >= threshold 0.7 will be taken as positive samples - neg_iou_thr=0.3, # IoU < threshold 0.3 will be taken as negative samples - min_pos_iou=0.3, # The minimal IoU threshold to take boxes as positive samples - match_low_quality=True, # Whether to match the boxes under low quality (see API doc for more details). - ignore_iof_thr=-1), # IoF threshold for ignoring bboxes - sampler=dict( # Config of positive/negative sampler - 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. - num=256, # Number of samples - pos_fraction=0.5, # The ratio of positive samples in the total samples. - neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples. - add_gt_as_proposals=False), # Whether add GT as proposals after sampling. - allowed_border=-1, # The border allowed after padding for valid anchors. - pos_weight=-1, # The weight of positive samples during training. - debug=False), # Whether to set the debug mode - rpn_proposal=dict( # The config to generate proposals during training - 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. - nms_pre=2000, # The number of boxes before NMS - nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`. - max_per_img=1000, # The number of boxes to be kept after NMS. - nms=dict( # Config of NMS - type='nms', # Type of NMS - iou_threshold=0.7 # NMS threshold - ), - min_bbox_size=0), # The allowed minimal box size - rcnn=dict( # The config for the roi heads. - assigner=dict( # Config of assigner for second stage, this is different for that in rpn - 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. - pos_iou_thr=0.5, # IoU >= threshold 0.5 will be taken as positive samples - neg_iou_thr=0.5, # IoU < threshold 0.5 will be taken as negative samples - min_pos_iou=0.5, # The minimal IoU threshold to take boxes as positive samples - match_low_quality=False, # Whether to match the boxes under low quality (see API doc for more details). - ignore_iof_thr=-1), # IoF threshold for ignoring bboxes - sampler=dict( - 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. - num=512, # Number of samples - pos_fraction=0.25, # The ratio of positive samples in the total samples. - neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples. - add_gt_as_proposals=True - ), # Whether add GT as proposals after sampling. - mask_size=28, # Size of mask - pos_weight=-1, # The weight of positive samples during training. - debug=False)) # Whether to set the debug mode -test_cfg = dict( # Config for testing hyperparameters for rpn and rcnn - rpn=dict( # The config to generate proposals during testing - 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. - nms_pre=1000, # The number of boxes before NMS - nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`. - max_per_img=1000, # The number of boxes to be kept after NMS. - nms=dict( # Config of NMS - type='nms', #Type of NMS - iou_threshold=0.7 # NMS threshold - ), - min_bbox_size=0), # The allowed minimal box size - rcnn=dict( # The config for the roi heads. - score_thr=0.05, # Threshold to filter out boxes - nms=dict( # Config of NMS in the second stage - type='nms', # Type of NMS - iou_thr=0.5), # NMS threshold - max_per_img=100, # Max number of detections of each image - mask_thr_binary=0.5)) # Threshold of mask prediction + loss_weight=1.0))), # Loss weight of mask branch. + train_cfg = dict( # Config of training hyperparameters for rpn and rcnn + rpn=dict( # Training config of rpn + assigner=dict( # Config of assigner + 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. + pos_iou_thr=0.7, # IoU >= threshold 0.7 will be taken as positive samples + neg_iou_thr=0.3, # IoU < threshold 0.3 will be taken as negative samples + min_pos_iou=0.3, # The minimal IoU threshold to take boxes as positive samples + match_low_quality=True, # Whether to match the boxes under low quality (see API doc for more details). + ignore_iof_thr=-1), # IoF threshold for ignoring bboxes + sampler=dict( # Config of positive/negative sampler + 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. + num=256, # Number of samples + pos_fraction=0.5, # The ratio of positive samples in the total samples. + neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples. + add_gt_as_proposals=False), # Whether add GT as proposals after sampling. + allowed_border=-1, # The border allowed after padding for valid anchors. + pos_weight=-1, # The weight of positive samples during training. + debug=False), # Whether to set the debug mode + rpn_proposal=dict( # The config to generate proposals during training + 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. + nms_pre=2000, # The number of boxes before NMS + nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`. + max_per_img=1000, # The number of boxes to be kept after NMS. + nms=dict( # Config of NMS + type='nms', # Type of NMS + iou_threshold=0.7 # NMS threshold + ), + min_bbox_size=0), # The allowed minimal box size + rcnn=dict( # The config for the roi heads. + assigner=dict( # Config of assigner for second stage, this is different for that in rpn + 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. + pos_iou_thr=0.5, # IoU >= threshold 0.5 will be taken as positive samples + neg_iou_thr=0.5, # IoU < threshold 0.5 will be taken as negative samples + min_pos_iou=0.5, # The minimal IoU threshold to take boxes as positive samples + match_low_quality=False, # Whether to match the boxes under low quality (see API doc for more details). + ignore_iof_thr=-1), # IoF threshold for ignoring bboxes + sampler=dict( + 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. + num=512, # Number of samples + pos_fraction=0.25, # The ratio of positive samples in the total samples. + neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples. + add_gt_as_proposals=True + ), # Whether add GT as proposals after sampling. + mask_size=28, # Size of mask + pos_weight=-1, # The weight of positive samples during training. + debug=False)), # Whether to set the debug mode + test_cfg = dict( # Config for testing hyperparameters for rpn and rcnn + rpn=dict( # The config to generate proposals during testing + 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. + nms_pre=1000, # The number of boxes before NMS + nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`. + max_per_img=1000, # The number of boxes to be kept after NMS. + nms=dict( # Config of NMS + type='nms', #Type of NMS + iou_threshold=0.7 # NMS threshold + ), + min_bbox_size=0), # The allowed minimal box size + rcnn=dict( # The config for the roi heads. + score_thr=0.05, # Threshold to filter out boxes + nms=dict( # Config of NMS in the second stage + type='nms', # Type of NMS + iou_thr=0.5), # NMS threshold + max_per_img=100, # Max number of detections of each image + mask_thr_binary=0.5))) # Threshold of mask prediction + dataset_type = 'CocoDataset' # Dataset type, this will be used to define the dataset data_root = 'data/coco/' # Root path of data img_norm_cfg = dict( # Image normalization config to normalize the input images diff --git a/docs/zh_cn/tutorials/config.md b/docs/zh_cn/tutorials/config.md index 40460878006..5ed9a6ed84a 100644 --- a/docs/zh_cn/tutorials/config.md +++ b/docs/zh_cn/tutorials/config.md @@ -164,71 +164,72 @@ model = dict( loss_mask=dict( # mask 分支的损失函数配置。 type='CrossEntropyLoss', # 用于分割的损失类型。 use_mask=True, # 是否只在正确的类中训练 mask。 - loss_weight=1.0)))) # mask 分支的损失权重. -train_cfg = dict( # rpn 和 rcnn 训练超参数的配置 - rpn=dict( # rpn 的训练配置 - assigner=dict( # 分配器(assigner)的配置 - type='MaxIoUAssigner', # 分配器的类型,MaxIoUAssigner 用于许多常见的检测器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10。 - pos_iou_thr=0.7, # IoU >= 0.7(阈值) 被视为正样本。 - neg_iou_thr=0.3, # IoU < 0.3(阈值) 被视为负样本。 - min_pos_iou=0.3, # 将框作为正样本的最小 IoU 阈值。 - match_low_quality=True, # 是否匹配低质量的框(更多细节见 API 文档). - ignore_iof_thr=-1), # 忽略 bbox 的 IoF 阈值。 - sampler=dict( # 正/负采样器(sampler)的配置 - type='RandomSampler', # 采样器类型,还支持 PseudoSampler 和其他采样器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8。 - num=256, # 样本数量。 - pos_fraction=0.5, # 正样本占总样本的比例。 - neg_pos_ub=-1, # 基于正样本数量的负样本上限。 - add_gt_as_proposals=False), # 采样后是否添加 GT 作为 proposal。 - allowed_border=-1, # 填充有效锚点后允许的边框。 - pos_weight=-1, # 训练期间正样本的权重。 - debug=False), # 是否设置调试(debug)模式 - rpn_proposal=dict( # 在训练期间生成 proposals 的配置 - nms_across_levels=False, # 是否对跨层的 box 做 NMS。仅适用于 `GARPNHead` ,naive rpn 不支持 nms cross levels。 - nms_pre=2000, # NMS 前的 box 数 - nms_post=1000, # NMS 要保留的 box 的数量,只在 GARPNHHead 中起作用。 - max_per_img=1000, # NMS 后要保留的 box 数量。 - nms=dict( # NMS 的配置 - type='nms', # NMS 的类别 - iou_threshold=0.7 # NMS 的阈值 - ), - min_bbox_size=0), # 允许的最小 box 尺寸 - rcnn=dict( # roi head 的配置。 - assigner=dict( # 第二阶段分配器的配置,这与 rpn 中的不同 - type='MaxIoUAssigner', # 分配器的类型,MaxIoUAssigner 目前用于所有 roi_heads。更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10。 - pos_iou_thr=0.5, # IoU >= 0.5(阈值)被认为是正样本。 - neg_iou_thr=0.5, # IoU < 0.5(阈值)被认为是负样本。 - min_pos_iou=0.5, # 将 box 作为正样本的最小 IoU 阈值 - match_low_quality=False, # 是否匹配低质量下的 box(有关更多详细信息,请参阅 API 文档)。 - ignore_iof_thr=-1), # 忽略 bbox 的 IoF 阈值 - sampler=dict( - type='RandomSampler', #采样器的类型,还支持 PseudoSampler 和其他采样器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8。 - num=512, # 样本数量 - pos_fraction=0.25, # 正样本占总样本的比例。. - neg_pos_ub=-1, # 基于正样本数量的负样本上限。. - add_gt_as_proposals=True - ), # 采样后是否添加 GT 作为 proposal。 - mask_size=28, # mask 的大小 - pos_weight=-1, # 训练期间正样本的权重。 - debug=False)) # 是否设置调试模式。 -test_cfg = dict( # 用于测试 rpn 和 rcnn 超参数的配置 - rpn=dict( # 测试阶段生成 proposals 的配置 - nms_across_levels=False, # 是否对跨层的 box 做 NMS。仅适用于`GARPNHead`,naive rpn 不支持做 NMS cross levels。 - nms_pre=1000, # NMS 前的 box 数 - nms_post=1000, # NMS 要保留的 box 的数量,只在`GARPNHHead`中起作用。 - max_per_img=1000, # NMS 后要保留的 box 数量 - nms=dict( # NMS 的配置 - type='nms', # NMS 的类型 - iou_threshold=0.7 # NMS 阈值 - ), - min_bbox_size=0), # box 允许的最小尺寸 - rcnn=dict( # roi heads 的配置 - score_thr=0.05, # bbox 的分数阈值 - nms=dict( # 第二步的 NMS 配置 - type='nms', # NMS 的类型 - iou_thr=0.5), # NMS 的阈值 - max_per_img=100, # 每张图像的最大检测次数 - mask_thr_binary=0.5)) # mask 预处的阈值 + loss_weight=1.0))), # mask 分支的损失权重. + train_cfg = dict( # rpn 和 rcnn 训练超参数的配置 + rpn=dict( # rpn 的训练配置 + assigner=dict( # 分配器(assigner)的配置 + type='MaxIoUAssigner', # 分配器的类型,MaxIoUAssigner 用于许多常见的检测器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10。 + pos_iou_thr=0.7, # IoU >= 0.7(阈值) 被视为正样本。 + neg_iou_thr=0.3, # IoU < 0.3(阈值) 被视为负样本。 + min_pos_iou=0.3, # 将框作为正样本的最小 IoU 阈值。 + match_low_quality=True, # 是否匹配低质量的框(更多细节见 API 文档). + ignore_iof_thr=-1), # 忽略 bbox 的 IoF 阈值。 + sampler=dict( # 正/负采样器(sampler)的配置 + type='RandomSampler', # 采样器类型,还支持 PseudoSampler 和其他采样器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8。 + num=256, # 样本数量。 + pos_fraction=0.5, # 正样本占总样本的比例。 + neg_pos_ub=-1, # 基于正样本数量的负样本上限。 + add_gt_as_proposals=False), # 采样后是否添加 GT 作为 proposal。 + allowed_border=-1, # 填充有效锚点后允许的边框。 + pos_weight=-1, # 训练期间正样本的权重。 + debug=False), # 是否设置调试(debug)模式 + rpn_proposal=dict( # 在训练期间生成 proposals 的配置 + nms_across_levels=False, # 是否对跨层的 box 做 NMS。仅适用于 `GARPNHead` ,naive rpn 不支持 nms cross levels。 + nms_pre=2000, # NMS 前的 box 数 + nms_post=1000, # NMS 要保留的 box 的数量,只在 GARPNHHead 中起作用。 + max_per_img=1000, # NMS 后要保留的 box 数量。 + nms=dict( # NMS 的配置 + type='nms', # NMS 的类别 + iou_threshold=0.7 # NMS 的阈值 + ), + min_bbox_size=0), # 允许的最小 box 尺寸 + rcnn=dict( # roi head 的配置。 + assigner=dict( # 第二阶段分配器的配置,这与 rpn 中的不同 + type='MaxIoUAssigner', # 分配器的类型,MaxIoUAssigner 目前用于所有 roi_heads。更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10。 + pos_iou_thr=0.5, # IoU >= 0.5(阈值)被认为是正样本。 + neg_iou_thr=0.5, # IoU < 0.5(阈值)被认为是负样本。 + min_pos_iou=0.5, # 将 box 作为正样本的最小 IoU 阈值 + match_low_quality=False, # 是否匹配低质量下的 box(有关更多详细信息,请参阅 API 文档)。 + ignore_iof_thr=-1), # 忽略 bbox 的 IoF 阈值 + sampler=dict( + type='RandomSampler', #采样器的类型,还支持 PseudoSampler 和其他采样器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8。 + num=512, # 样本数量 + pos_fraction=0.25, # 正样本占总样本的比例。. + neg_pos_ub=-1, # 基于正样本数量的负样本上限。. + add_gt_as_proposals=True + ), # 采样后是否添加 GT 作为 proposal。 + mask_size=28, # mask 的大小 + pos_weight=-1, # 训练期间正样本的权重。 + debug=False)), # 是否设置调试模式。 + test_cfg = dict( # 用于测试 rpn 和 rcnn 超参数的配置 + rpn=dict( # 测试阶段生成 proposals 的配置 + nms_across_levels=False, # 是否对跨层的 box 做 NMS。仅适用于`GARPNHead`,naive rpn 不支持做 NMS cross levels。 + nms_pre=1000, # NMS 前的 box 数 + nms_post=1000, # NMS 要保留的 box 的数量,只在`GARPNHHead`中起作用。 + max_per_img=1000, # NMS 后要保留的 box 数量 + nms=dict( # NMS 的配置 + type='nms', # NMS 的类型 + iou_threshold=0.7 # NMS 阈值 + ), + min_bbox_size=0), # box 允许的最小尺寸 + rcnn=dict( # roi heads 的配置 + score_thr=0.05, # bbox 的分数阈值 + nms=dict( # 第二步的 NMS 配置 + type='nms', # NMS 的类型 + iou_thr=0.5), # NMS 的阈值 + max_per_img=100, # 每张图像的最大检测次数 + mask_thr_binary=0.5))) # mask 预处的阈值 + dataset_type = 'CocoDataset' # 数据集类型,这将被用来定义数据集。 data_root = 'data/coco/' # 数据的根路径。 img_norm_cfg = dict( # 图像归一化配置,用来归一化输入的图像。