rtmdet_s_8xb32-300e_coco.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. _base_ = './rtmdet_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, exp_on_reg=False))
  11. train_pipeline = [
  12. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  13. dict(type='LoadAnnotations', with_bbox=True),
  14. dict(type='CachedMosaic', img_scale=(640, 640), pad_val=114.0),
  15. dict(
  16. type='RandomResize',
  17. scale=(1280, 1280),
  18. ratio_range=(0.5, 2.0),
  19. keep_ratio=True),
  20. dict(type='RandomCrop', crop_size=(640, 640)),
  21. dict(type='YOLOXHSVRandomAug'),
  22. dict(type='RandomFlip', prob=0.5),
  23. dict(type='Pad', size=(640, 640), pad_val=dict(img=(114, 114, 114))),
  24. dict(
  25. type='CachedMixUp',
  26. img_scale=(640, 640),
  27. ratio_range=(1.0, 1.0),
  28. max_cached_images=20,
  29. pad_val=(114, 114, 114)),
  30. dict(type='PackDetInputs')
  31. ]
  32. train_pipeline_stage2 = [
  33. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  34. dict(type='LoadAnnotations', with_bbox=True),
  35. dict(
  36. type='RandomResize',
  37. scale=(640, 640),
  38. ratio_range=(0.5, 2.0),
  39. keep_ratio=True),
  40. dict(type='RandomCrop', crop_size=(640, 640)),
  41. dict(type='YOLOXHSVRandomAug'),
  42. dict(type='RandomFlip', prob=0.5),
  43. dict(type='Pad', size=(640, 640), pad_val=dict(img=(114, 114, 114))),
  44. dict(type='PackDetInputs')
  45. ]
  46. train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
  47. custom_hooks = [
  48. dict(
  49. type='EMAHook',
  50. ema_type='ExpMomentumEMA',
  51. momentum=0.0002,
  52. update_buffers=True,
  53. priority=49),
  54. dict(
  55. type='PipelineSwitchHook',
  56. switch_epoch=280,
  57. switch_pipeline=train_pipeline_stage2)
  58. ]