solov2-light_r50_fpn_ms-3x_coco.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. _base_ = './solov2_r50_fpn_1x_coco.py'
  2. # model settings
  3. model = dict(
  4. mask_head=dict(
  5. stacked_convs=2,
  6. feat_channels=256,
  7. scale_ranges=((1, 56), (28, 112), (56, 224), (112, 448), (224, 896)),
  8. mask_feature_head=dict(out_channels=128)))
  9. # dataset settings
  10. train_pipeline = [
  11. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  12. dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
  13. dict(
  14. type='RandomChoiceResize',
  15. scales=[(768, 512), (768, 480), (768, 448), (768, 416), (768, 384),
  16. (768, 352)],
  17. keep_ratio=True),
  18. dict(type='RandomFlip', prob=0.5),
  19. dict(type='PackDetInputs')
  20. ]
  21. test_pipeline = [
  22. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  23. dict(type='Resize', scale=(448, 768), keep_ratio=True),
  24. dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
  25. dict(
  26. type='PackDetInputs',
  27. meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
  28. 'scale_factor'))
  29. ]
  30. train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
  31. val_dataloader = dict(dataset=dict(pipeline=test_pipeline))
  32. test_dataloader = val_dataloader
  33. # training schedule for 3x
  34. max_epochs = 36
  35. train_cfg = dict(by_epoch=True, max_epochs=max_epochs)
  36. # learning rate
  37. param_scheduler = [
  38. dict(
  39. type='LinearLR',
  40. start_factor=1.0 / 3,
  41. by_epoch=False,
  42. begin=0,
  43. end=500),
  44. dict(
  45. type='MultiStepLR',
  46. begin=0,
  47. end=36,
  48. by_epoch=True,
  49. milestones=[27, 33],
  50. gamma=0.1)
  51. ]