libra-fast-rcnn_r50_fpn_1x_coco.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. _base_ = '../fast_rcnn/fast-rcnn_r50_fpn_1x_coco.py'
  2. # model settings
  3. model = dict(
  4. neck=[
  5. dict(
  6. type='FPN',
  7. in_channels=[256, 512, 1024, 2048],
  8. out_channels=256,
  9. num_outs=5),
  10. dict(
  11. type='BFP',
  12. in_channels=256,
  13. num_levels=5,
  14. refine_level=2,
  15. refine_type='non_local')
  16. ],
  17. roi_head=dict(
  18. bbox_head=dict(
  19. loss_bbox=dict(
  20. _delete_=True,
  21. type='BalancedL1Loss',
  22. alpha=0.5,
  23. gamma=1.5,
  24. beta=1.0,
  25. loss_weight=1.0))),
  26. # model training and testing settings
  27. train_cfg=dict(
  28. rcnn=dict(
  29. sampler=dict(
  30. _delete_=True,
  31. type='CombinedSampler',
  32. num=512,
  33. pos_fraction=0.25,
  34. add_gt_as_proposals=True,
  35. pos_sampler=dict(type='InstanceBalancedPosSampler'),
  36. neg_sampler=dict(
  37. type='IoUBalancedNegSampler',
  38. floor_thr=-1,
  39. floor_fraction=0,
  40. num_bins=3)))))
  41. # MMEngine support the following two ways, users can choose
  42. # according to convenience
  43. # _base_.train_dataloader.dataset.proposal_file = 'libra_proposals/rpn_r50_fpn_1x_train2017.pkl' # noqa
  44. train_dataloader = dict(
  45. dataset=dict(proposal_file='libra_proposals/rpn_r50_fpn_1x_train2017.pkl'))
  46. # _base_.val_dataloader.dataset.proposal_file = 'libra_proposals/rpn_r50_fpn_1x_val2017.pkl' # noqa
  47. # test_dataloader = _base_.val_dataloader
  48. val_dataloader = dict(
  49. dataset=dict(proposal_file='libra_proposals/rpn_r50_fpn_1x_val2017.pkl'))
  50. test_dataloader = val_dataloader