ga-rpn_r50_fpn_1x_coco.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. _base_ = '../rpn/rpn_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. # model training and testing settings
  39. train_cfg=dict(
  40. rpn=dict(
  41. ga_assigner=dict(
  42. type='ApproxMaxIoUAssigner',
  43. pos_iou_thr=0.7,
  44. neg_iou_thr=0.3,
  45. min_pos_iou=0.3,
  46. ignore_iof_thr=-1),
  47. ga_sampler=dict(
  48. type='RandomSampler',
  49. num=256,
  50. pos_fraction=0.5,
  51. neg_pos_ub=-1,
  52. add_gt_as_proposals=False),
  53. allowed_border=-1,
  54. center_ratio=0.2,
  55. ignore_ratio=0.5)),
  56. test_cfg=dict(rpn=dict(nms_post=1000)))
  57. optim_wrapper = dict(clip_grad=dict(max_norm=35, norm_type=2))