rtmdet_nano_320-8xb32_coco-person.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. _base_ = 'mmdet::rtmdet/rtmdet_l_8xb32-300e_coco.py'
  2. input_shape = 320
  3. model = dict(
  4. backbone=dict(
  5. deepen_factor=0.33,
  6. widen_factor=0.25,
  7. use_depthwise=True,
  8. ),
  9. neck=dict(
  10. in_channels=[64, 128, 256],
  11. out_channels=64,
  12. num_csp_blocks=1,
  13. use_depthwise=True,
  14. ),
  15. bbox_head=dict(
  16. in_channels=64,
  17. feat_channels=64,
  18. share_conv=False,
  19. exp_on_reg=False,
  20. use_depthwise=True,
  21. num_classes=1),
  22. test_cfg=dict(
  23. nms_pre=1000,
  24. min_bbox_size=0,
  25. score_thr=0.05,
  26. nms=dict(type='nms', iou_threshold=0.6),
  27. max_per_img=100))
  28. train_pipeline = [
  29. dict(type='LoadImageFromFile'),
  30. dict(type='LoadAnnotations', with_bbox=True),
  31. dict(
  32. type='CachedMosaic',
  33. img_scale=(input_shape, input_shape),
  34. pad_val=114.0,
  35. max_cached_images=20,
  36. random_pop=False),
  37. dict(
  38. type='RandomResize',
  39. scale=(input_shape * 2, input_shape * 2),
  40. ratio_range=(0.5, 1.5),
  41. keep_ratio=True),
  42. dict(type='RandomCrop', crop_size=(input_shape, input_shape)),
  43. dict(type='YOLOXHSVRandomAug'),
  44. dict(type='RandomFlip', prob=0.5),
  45. dict(
  46. type='Pad',
  47. size=(input_shape, input_shape),
  48. pad_val=dict(img=(114, 114, 114))),
  49. dict(type='PackDetInputs')
  50. ]
  51. train_pipeline_stage2 = [
  52. dict(type='LoadImageFromFile'),
  53. dict(type='LoadAnnotations', with_bbox=True),
  54. dict(
  55. type='RandomResize',
  56. scale=(input_shape, input_shape),
  57. ratio_range=(0.5, 1.5),
  58. keep_ratio=True),
  59. dict(type='RandomCrop', crop_size=(input_shape, input_shape)),
  60. dict(type='YOLOXHSVRandomAug'),
  61. dict(type='RandomFlip', prob=0.5),
  62. dict(
  63. type='Pad',
  64. size=(input_shape, input_shape),
  65. pad_val=dict(img=(114, 114, 114))),
  66. dict(type='PackDetInputs')
  67. ]
  68. test_pipeline = [
  69. dict(type='LoadImageFromFile'),
  70. dict(type='Resize', scale=(input_shape, input_shape), keep_ratio=True),
  71. dict(
  72. type='Pad',
  73. size=(input_shape, input_shape),
  74. pad_val=dict(img=(114, 114, 114))),
  75. dict(
  76. type='PackDetInputs',
  77. meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
  78. 'scale_factor'))
  79. ]
  80. train_dataloader = dict(
  81. dataset=dict(pipeline=train_pipeline, metainfo=dict(classes=('person', ))))
  82. val_dataloader = dict(
  83. dataset=dict(pipeline=test_pipeline, metainfo=dict(classes=('person', ))))
  84. test_dataloader = val_dataloader
  85. custom_hooks = [
  86. dict(
  87. type='EMAHook',
  88. ema_type='ExpMomentumEMA',
  89. momentum=0.0002,
  90. update_buffers=True,
  91. priority=49),
  92. dict(
  93. type='PipelineSwitchHook',
  94. switch_epoch=280,
  95. switch_pipeline=train_pipeline_stage2)
  96. ]