rtmdet-ins_s_8xb32-300e_coco.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. _base_ = './rtmdet-ins_l_8xb32-300e_coco.py'
  2. checkpoint = 'https://download.openmmlab.com/mmdetection/v3.0/rtmdet/cspnext_rsb_pretrain/cspnext-s_imagenet_600e.pth' # noqa
  3. model = dict(
  4. backbone=dict(
  5. deepen_factor=0.33,
  6. widen_factor=0.5,
  7. init_cfg=dict(
  8. type='Pretrained', prefix='backbone.', checkpoint=checkpoint)),
  9. neck=dict(in_channels=[128, 256, 512], out_channels=128, num_csp_blocks=1),
  10. bbox_head=dict(in_channels=128, feat_channels=128))
  11. train_pipeline = [
  12. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  13. dict(
  14. type='LoadAnnotations',
  15. with_bbox=True,
  16. with_mask=True,
  17. poly2mask=False),
  18. dict(type='CachedMosaic', img_scale=(640, 640), pad_val=114.0),
  19. dict(
  20. type='RandomResize',
  21. scale=(1280, 1280),
  22. ratio_range=(0.5, 2.0),
  23. keep_ratio=True),
  24. dict(
  25. type='RandomCrop',
  26. crop_size=(640, 640),
  27. recompute_bbox=True,
  28. allow_negative_crop=True),
  29. dict(type='YOLOXHSVRandomAug'),
  30. dict(type='RandomFlip', prob=0.5),
  31. dict(type='Pad', size=(640, 640), pad_val=dict(img=(114, 114, 114))),
  32. dict(
  33. type='CachedMixUp',
  34. img_scale=(640, 640),
  35. ratio_range=(1.0, 1.0),
  36. max_cached_images=20,
  37. pad_val=(114, 114, 114)),
  38. dict(type='FilterAnnotations', min_gt_bbox_wh=(1, 1)),
  39. dict(type='PackDetInputs')
  40. ]
  41. train_pipeline_stage2 = [
  42. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  43. dict(
  44. type='LoadAnnotations',
  45. with_bbox=True,
  46. with_mask=True,
  47. poly2mask=False),
  48. dict(
  49. type='RandomResize',
  50. scale=(640, 640),
  51. ratio_range=(0.5, 2.0),
  52. keep_ratio=True),
  53. dict(
  54. type='RandomCrop',
  55. crop_size=(640, 640),
  56. recompute_bbox=True,
  57. allow_negative_crop=True),
  58. dict(type='FilterAnnotations', min_gt_bbox_wh=(1, 1)),
  59. dict(type='YOLOXHSVRandomAug'),
  60. dict(type='RandomFlip', prob=0.5),
  61. dict(type='Pad', size=(640, 640), pad_val=dict(img=(114, 114, 114))),
  62. dict(type='PackDetInputs')
  63. ]
  64. train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
  65. custom_hooks = [
  66. dict(
  67. type='EMAHook',
  68. ema_type='ExpMomentumEMA',
  69. momentum=0.0002,
  70. update_buffers=True,
  71. priority=49),
  72. dict(
  73. type='PipelineSwitchHook',
  74. switch_epoch=280,
  75. switch_pipeline=train_pipeline_stage2)
  76. ]