mask-rcnn_s50_fpn_syncbn-backbone+head_ms-1x_coco.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. _base_ = '../mask_rcnn/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=dict(
  25. type='Shared4Conv1FCBBoxHead',
  26. conv_out_channels=256,
  27. norm_cfg=norm_cfg),
  28. mask_head=dict(norm_cfg=norm_cfg)))
  29. train_pipeline = [
  30. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  31. dict(
  32. type='LoadAnnotations',
  33. with_bbox=True,
  34. with_mask=True,
  35. poly2mask=False),
  36. dict(
  37. type='RandomChoiceResize',
  38. scales=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
  39. (1333, 768), (1333, 800)],
  40. keep_ratio=True),
  41. dict(type='RandomFlip', prob=0.5),
  42. dict(type='PackDetInputs')
  43. ]
  44. train_dataloader = dict(dataset=dict(pipeline=train_pipeline))