ga-fast-rcnn_r50-caffe_fpn_1x_coco.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. _base_ = '../fast_rcnn/fast-rcnn_r50_fpn_1x_coco.py'
  2. model = dict(
  3. backbone=dict(
  4. type='ResNet',
  5. depth=50,
  6. num_stages=4,
  7. out_indices=(0, 1, 2, 3),
  8. frozen_stages=1,
  9. norm_cfg=dict(type='BN', requires_grad=False),
  10. norm_eval=True,
  11. style='caffe',
  12. init_cfg=dict(
  13. type='Pretrained',
  14. checkpoint='open-mmlab://detectron2/resnet50_caffe')),
  15. roi_head=dict(
  16. bbox_head=dict(bbox_coder=dict(target_stds=[0.05, 0.05, 0.1, 0.1]))),
  17. # model training and testing settings
  18. train_cfg=dict(
  19. rcnn=dict(
  20. assigner=dict(pos_iou_thr=0.6, neg_iou_thr=0.6, min_pos_iou=0.6),
  21. sampler=dict(num=256))),
  22. test_cfg=dict(rcnn=dict(score_thr=1e-3)))
  23. dataset_type = 'CocoDataset'
  24. data_root = 'data/coco/'
  25. img_norm_cfg = dict(
  26. mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False)
  27. train_pipeline = [
  28. dict(type='LoadImageFromFile'),
  29. dict(type='LoadProposals', num_max_proposals=300),
  30. dict(type='LoadAnnotations', with_bbox=True),
  31. dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
  32. dict(type='RandomFlip', flip_ratio=0.5),
  33. dict(type='Normalize', **img_norm_cfg),
  34. dict(type='Pad', size_divisor=32),
  35. dict(type='DefaultFormatBundle'),
  36. dict(type='Collect', keys=['img', 'proposals', 'gt_bboxes', 'gt_labels']),
  37. ]
  38. test_pipeline = [
  39. dict(type='LoadImageFromFile'),
  40. dict(type='LoadProposals', num_max_proposals=None),
  41. dict(
  42. type='MultiScaleFlipAug',
  43. img_scale=(1333, 800),
  44. flip=False,
  45. transforms=[
  46. dict(type='Resize', keep_ratio=True),
  47. dict(type='RandomFlip'),
  48. dict(type='Normalize', **img_norm_cfg),
  49. dict(type='Pad', size_divisor=32),
  50. dict(type='ImageToTensor', keys=['img']),
  51. dict(type='Collect', keys=['img', 'proposals']),
  52. ])
  53. ]
  54. # TODO: support loading proposals
  55. data = dict(
  56. train=dict(
  57. proposal_file=data_root + 'proposals/ga_rpn_r50_fpn_1x_train2017.pkl',
  58. pipeline=train_pipeline),
  59. val=dict(
  60. proposal_file=data_root + 'proposals/ga_rpn_r50_fpn_1x_val2017.pkl',
  61. pipeline=test_pipeline),
  62. test=dict(
  63. proposal_file=data_root + 'proposals/ga_rpn_r50_fpn_1x_val2017.pkl',
  64. pipeline=test_pipeline))
  65. optimizer_config = dict(
  66. _delete_=True, grad_clip=dict(max_norm=35, norm_type=2))