rpn_r50-caffe-c4.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # model settings
  2. model = dict(
  3. type='RPN',
  4. data_preprocessor=dict(
  5. type='DetDataPreprocessor',
  6. mean=[103.530, 116.280, 123.675],
  7. std=[1.0, 1.0, 1.0],
  8. bgr_to_rgb=False,
  9. pad_size_divisor=32),
  10. backbone=dict(
  11. type='ResNet',
  12. depth=50,
  13. num_stages=3,
  14. strides=(1, 2, 2),
  15. dilations=(1, 1, 1),
  16. out_indices=(2, ),
  17. frozen_stages=1,
  18. norm_cfg=dict(type='BN', requires_grad=False),
  19. norm_eval=True,
  20. style='caffe',
  21. init_cfg=dict(
  22. type='Pretrained',
  23. checkpoint='open-mmlab://detectron2/resnet50_caffe')),
  24. neck=None,
  25. rpn_head=dict(
  26. type='RPNHead',
  27. in_channels=1024,
  28. feat_channels=1024,
  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. # model training and testing settings
  42. train_cfg=dict(
  43. rpn=dict(
  44. assigner=dict(
  45. type='MaxIoUAssigner',
  46. pos_iou_thr=0.7,
  47. neg_iou_thr=0.3,
  48. min_pos_iou=0.3,
  49. ignore_iof_thr=-1),
  50. sampler=dict(
  51. type='RandomSampler',
  52. num=256,
  53. pos_fraction=0.5,
  54. neg_pos_ub=-1,
  55. add_gt_as_proposals=False),
  56. allowed_border=-1,
  57. pos_weight=-1,
  58. debug=False)),
  59. test_cfg=dict(
  60. rpn=dict(
  61. nms_pre=12000,
  62. max_per_img=2000,
  63. nms=dict(type='nms', iou_threshold=0.7),
  64. min_bbox_size=0)))