d2_mask-rcnn_r50-caffe_fpn_ms-90k_coco.py 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. _base_ = '../common/ms-poly-90k_coco-instance.py'
  2. # model settings
  3. model = dict(
  4. type='Detectron2Wrapper',
  5. bgr_to_rgb=False,
  6. detector=dict(
  7. # The settings in `d2_detector` will merged into default settings
  8. # in detectron2. More details please refer to
  9. # https://github.com/facebookresearch/detectron2/blob/main/detectron2/config/defaults.py # noqa
  10. meta_architecture='GeneralizedRCNN',
  11. # If you want to finetune the detector, you can use the
  12. # checkpoint released by detectron2, for example:
  13. # weights='detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x/137260431/model_final_a54504.pkl' # noqa
  14. weights='detectron2://ImageNetPretrained/MSRA/R-50.pkl',
  15. mask_on=True,
  16. pixel_mean=[103.530, 116.280, 123.675],
  17. pixel_std=[1.0, 1.0, 1.0],
  18. backbone=dict(name='build_resnet_fpn_backbone', freeze_at=2),
  19. resnets=dict(
  20. depth=50,
  21. out_features=['res2', 'res3', 'res4', 'res5'],
  22. num_groups=1,
  23. norm='FrozenBN'),
  24. fpn=dict(
  25. in_features=['res2', 'res3', 'res4', 'res5'], out_channels=256),
  26. anchor_generator=dict(
  27. name='DefaultAnchorGenerator',
  28. sizes=[[32], [64], [128], [256], [512]],
  29. aspect_ratios=[[0.5, 1.0, 2.0]],
  30. angles=[[-90, 0, 90]]),
  31. proposal_generator=dict(name='RPN'),
  32. rpn=dict(
  33. head_name='StandardRPNHead',
  34. in_features=['p2', 'p3', 'p4', 'p5', 'p6'],
  35. iou_thresholds=[0.3, 0.7],
  36. iou_labels=[0, -1, 1],
  37. batch_size_per_image=256,
  38. positive_fraction=0.5,
  39. bbox_reg_loss_type='smooth_l1',
  40. bbox_reg_loss_weight=1.0,
  41. bbox_reg_weights=(1.0, 1.0, 1.0, 1.0),
  42. smooth_l1_beta=0.0,
  43. loss_weight=1.0,
  44. boundary_thresh=-1,
  45. pre_nms_topk_train=2000,
  46. post_nms_topk_train=1000,
  47. pre_nms_topk_test=1000,
  48. post_nms_topk_test=1000,
  49. nms_thresh=0.7,
  50. conv_dims=[-1]),
  51. roi_heads=dict(
  52. name='StandardROIHeads',
  53. num_classes=80,
  54. in_features=['p2', 'p3', 'p4', 'p5'],
  55. iou_thresholds=[0.5],
  56. iou_labels=[0, 1],
  57. batch_size_per_image=512,
  58. positive_fraction=0.25,
  59. score_thresh_test=0.05,
  60. nms_thresh_test=0.5,
  61. proposal_append_gt=True),
  62. roi_box_head=dict(
  63. name='FastRCNNConvFCHead',
  64. num_fc=2,
  65. fc_dim=1024,
  66. conv_dim=256,
  67. pooler_type='ROIAlignV2',
  68. pooler_resolution=7,
  69. pooler_sampling_ratio=0,
  70. bbox_reg_loss_type='smooth_l1',
  71. bbox_reg_loss_weight=1.0,
  72. bbox_reg_weights=(10.0, 10.0, 5.0, 5.0),
  73. smooth_l1_beta=0.0,
  74. cls_agnostic_bbox_reg=False),
  75. roi_mask_head=dict(
  76. name='MaskRCNNConvUpsampleHead',
  77. conv_dim=256,
  78. num_conv=4,
  79. pooler_type='ROIAlignV2',
  80. pooler_resolution=14,
  81. pooler_sampling_ratio=0,
  82. cls_agnostic_mask=False)))