ga-faster-rcnn_r50_fpn_1x_coco.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. _base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py'
  2. model = dict(
  3. rpn_head=dict(
  4. _delete_=True,
  5. type='GARPNHead',
  6. in_channels=256,
  7. feat_channels=256,
  8. approx_anchor_generator=dict(
  9. type='AnchorGenerator',
  10. octave_base_scale=8,
  11. scales_per_octave=3,
  12. ratios=[0.5, 1.0, 2.0],
  13. strides=[4, 8, 16, 32, 64]),
  14. square_anchor_generator=dict(
  15. type='AnchorGenerator',
  16. ratios=[1.0],
  17. scales=[8],
  18. strides=[4, 8, 16, 32, 64]),
  19. anchor_coder=dict(
  20. type='DeltaXYWHBBoxCoder',
  21. target_means=[.0, .0, .0, .0],
  22. target_stds=[0.07, 0.07, 0.14, 0.14]),
  23. bbox_coder=dict(
  24. type='DeltaXYWHBBoxCoder',
  25. target_means=[.0, .0, .0, .0],
  26. target_stds=[0.07, 0.07, 0.11, 0.11]),
  27. loc_filter_thr=0.01,
  28. loss_loc=dict(
  29. type='FocalLoss',
  30. use_sigmoid=True,
  31. gamma=2.0,
  32. alpha=0.25,
  33. loss_weight=1.0),
  34. loss_shape=dict(type='BoundedIoULoss', beta=0.2, loss_weight=1.0),
  35. loss_cls=dict(
  36. type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
  37. loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)),
  38. roi_head=dict(
  39. bbox_head=dict(bbox_coder=dict(target_stds=[0.05, 0.05, 0.1, 0.1]))),
  40. # model training and testing settings
  41. train_cfg=dict(
  42. rpn=dict(
  43. ga_assigner=dict(
  44. type='ApproxMaxIoUAssigner',
  45. pos_iou_thr=0.7,
  46. neg_iou_thr=0.3,
  47. min_pos_iou=0.3,
  48. ignore_iof_thr=-1),
  49. ga_sampler=dict(
  50. type='RandomSampler',
  51. num=256,
  52. pos_fraction=0.5,
  53. neg_pos_ub=-1,
  54. add_gt_as_proposals=False),
  55. allowed_border=-1,
  56. center_ratio=0.2,
  57. ignore_ratio=0.5),
  58. rpn_proposal=dict(nms_post=1000, max_per_img=300),
  59. rcnn=dict(
  60. assigner=dict(pos_iou_thr=0.6, neg_iou_thr=0.6, min_pos_iou=0.6),
  61. sampler=dict(type='RandomSampler', num=256))),
  62. test_cfg=dict(
  63. rpn=dict(nms_post=1000, max_per_img=300), rcnn=dict(score_thr=1e-3)))
  64. optim_wrapper = dict(clip_grad=dict(max_norm=35, norm_type=2))