cascade-mask-rcnn_s50_fpn_syncbn-backbone+head_ms-1x_coco.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. _base_ = '../cascade_rcnn/cascade-mask-rcnn_r50_fpn_1x_coco.py'
  2. norm_cfg = dict(type='SyncBN', requires_grad=True)
  3. model = dict(
  4. # use ResNeSt img_norm
  5. data_preprocessor=dict(
  6. mean=[123.68, 116.779, 103.939],
  7. std=[58.393, 57.12, 57.375],
  8. bgr_to_rgb=True),
  9. backbone=dict(
  10. type='ResNeSt',
  11. stem_channels=64,
  12. depth=50,
  13. radix=2,
  14. reduction_factor=4,
  15. avg_down_stride=True,
  16. num_stages=4,
  17. out_indices=(0, 1, 2, 3),
  18. frozen_stages=1,
  19. norm_cfg=norm_cfg,
  20. norm_eval=False,
  21. style='pytorch',
  22. init_cfg=dict(type='Pretrained', checkpoint='open-mmlab://resnest50')),
  23. roi_head=dict(
  24. bbox_head=[
  25. dict(
  26. type='Shared4Conv1FCBBoxHead',
  27. in_channels=256,
  28. conv_out_channels=256,
  29. fc_out_channels=1024,
  30. norm_cfg=norm_cfg,
  31. roi_feat_size=7,
  32. num_classes=80,
  33. bbox_coder=dict(
  34. type='DeltaXYWHBBoxCoder',
  35. target_means=[0., 0., 0., 0.],
  36. target_stds=[0.1, 0.1, 0.2, 0.2]),
  37. reg_class_agnostic=True,
  38. loss_cls=dict(
  39. type='CrossEntropyLoss',
  40. use_sigmoid=False,
  41. loss_weight=1.0),
  42. loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
  43. loss_weight=1.0)),
  44. dict(
  45. type='Shared4Conv1FCBBoxHead',
  46. in_channels=256,
  47. conv_out_channels=256,
  48. fc_out_channels=1024,
  49. norm_cfg=norm_cfg,
  50. roi_feat_size=7,
  51. num_classes=80,
  52. bbox_coder=dict(
  53. type='DeltaXYWHBBoxCoder',
  54. target_means=[0., 0., 0., 0.],
  55. target_stds=[0.05, 0.05, 0.1, 0.1]),
  56. reg_class_agnostic=True,
  57. loss_cls=dict(
  58. type='CrossEntropyLoss',
  59. use_sigmoid=False,
  60. loss_weight=1.0),
  61. loss_bbox=dict(type='SmoothL1Loss', beta=1.0,
  62. loss_weight=1.0)),
  63. dict(
  64. type='Shared4Conv1FCBBoxHead',
  65. in_channels=256,
  66. conv_out_channels=256,
  67. fc_out_channels=1024,
  68. norm_cfg=norm_cfg,
  69. roi_feat_size=7,
  70. num_classes=80,
  71. bbox_coder=dict(
  72. type='DeltaXYWHBBoxCoder',
  73. target_means=[0., 0., 0., 0.],
  74. target_stds=[0.033, 0.033, 0.067, 0.067]),
  75. reg_class_agnostic=True,
  76. loss_cls=dict(
  77. type='CrossEntropyLoss',
  78. use_sigmoid=False,
  79. loss_weight=1.0),
  80. loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))
  81. ],
  82. mask_head=dict(norm_cfg=norm_cfg)))
  83. train_pipeline = [
  84. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  85. dict(
  86. type='LoadAnnotations',
  87. with_bbox=True,
  88. with_mask=True,
  89. poly2mask=False),
  90. dict(
  91. type='RandomChoiceResize',
  92. scales=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
  93. (1333, 768), (1333, 800)],
  94. keep_ratio=True),
  95. dict(type='RandomFlip', prob=0.5),
  96. dict(type='PackDetInputs')
  97. ]
  98. train_dataloader = dict(dataset=dict(pipeline=train_pipeline))