faster-rcnn_r50-caffe-dc5.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # model settings
  2. norm_cfg = dict(type='BN', requires_grad=False)
  3. model = dict(
  4. type='FasterRCNN',
  5. data_preprocessor=dict(
  6. type='DetDataPreprocessor',
  7. mean=[103.530, 116.280, 123.675],
  8. std=[1.0, 1.0, 1.0],
  9. bgr_to_rgb=False,
  10. pad_size_divisor=32),
  11. backbone=dict(
  12. type='ResNet',
  13. depth=50,
  14. num_stages=4,
  15. strides=(1, 2, 2, 1),
  16. dilations=(1, 1, 1, 2),
  17. out_indices=(3, ),
  18. frozen_stages=1,
  19. norm_cfg=norm_cfg,
  20. norm_eval=True,
  21. style='caffe',
  22. init_cfg=dict(
  23. type='Pretrained',
  24. checkpoint='open-mmlab://detectron2/resnet50_caffe')),
  25. rpn_head=dict(
  26. type='RPNHead',
  27. in_channels=2048,
  28. feat_channels=2048,
  29. anchor_generator=dict(
  30. type='AnchorGenerator',
  31. scales=[2, 4, 8, 16, 32],
  32. ratios=[0.5, 1.0, 2.0],
  33. strides=[16]),
  34. bbox_coder=dict(
  35. type='DeltaXYWHBBoxCoder',
  36. target_means=[.0, .0, .0, .0],
  37. target_stds=[1.0, 1.0, 1.0, 1.0]),
  38. loss_cls=dict(
  39. type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
  40. loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
  41. roi_head=dict(
  42. type='StandardRoIHead',
  43. bbox_roi_extractor=dict(
  44. type='SingleRoIExtractor',
  45. roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
  46. out_channels=2048,
  47. featmap_strides=[16]),
  48. bbox_head=dict(
  49. type='Shared2FCBBoxHead',
  50. in_channels=2048,
  51. fc_out_channels=1024,
  52. roi_feat_size=7,
  53. num_classes=80,
  54. bbox_coder=dict(
  55. type='DeltaXYWHBBoxCoder',
  56. target_means=[0., 0., 0., 0.],
  57. target_stds=[0.1, 0.1, 0.2, 0.2]),
  58. reg_class_agnostic=False,
  59. loss_cls=dict(
  60. type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
  61. loss_bbox=dict(type='L1Loss', loss_weight=1.0))),
  62. # model training and testing settings
  63. train_cfg=dict(
  64. rpn=dict(
  65. assigner=dict(
  66. type='MaxIoUAssigner',
  67. pos_iou_thr=0.7,
  68. neg_iou_thr=0.3,
  69. min_pos_iou=0.3,
  70. match_low_quality=True,
  71. ignore_iof_thr=-1),
  72. sampler=dict(
  73. type='RandomSampler',
  74. num=256,
  75. pos_fraction=0.5,
  76. neg_pos_ub=-1,
  77. add_gt_as_proposals=False),
  78. allowed_border=0,
  79. pos_weight=-1,
  80. debug=False),
  81. rpn_proposal=dict(
  82. nms_pre=12000,
  83. max_per_img=2000,
  84. nms=dict(type='nms', iou_threshold=0.7),
  85. min_bbox_size=0),
  86. rcnn=dict(
  87. assigner=dict(
  88. type='MaxIoUAssigner',
  89. pos_iou_thr=0.5,
  90. neg_iou_thr=0.5,
  91. min_pos_iou=0.5,
  92. match_low_quality=False,
  93. ignore_iof_thr=-1),
  94. sampler=dict(
  95. type='RandomSampler',
  96. num=512,
  97. pos_fraction=0.25,
  98. neg_pos_ub=-1,
  99. add_gt_as_proposals=True),
  100. pos_weight=-1,
  101. debug=False)),
  102. test_cfg=dict(
  103. rpn=dict(
  104. nms=dict(type='nms', iou_threshold=0.7),
  105. nms_pre=6000,
  106. max_per_img=1000,
  107. min_bbox_size=0),
  108. rcnn=dict(
  109. score_thr=0.05,
  110. nms=dict(type='nms', iou_threshold=0.5),
  111. max_per_img=100)))