decoupled-solo-light_r50_fpn_3x_coco.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. _base_ = './decoupled-solo_r50_fpn_3x_coco.py'
  2. # model settings
  3. model = dict(
  4. mask_head=dict(
  5. type='DecoupledSOLOLightHead',
  6. num_classes=80,
  7. in_channels=256,
  8. stacked_convs=4,
  9. feat_channels=256,
  10. strides=[8, 8, 16, 32, 32],
  11. scale_ranges=((1, 64), (32, 128), (64, 256), (128, 512), (256, 2048)),
  12. pos_scale=0.2,
  13. num_grids=[40, 36, 24, 16, 12],
  14. cls_down_index=0,
  15. loss_mask=dict(
  16. type='DiceLoss', use_sigmoid=True, activate=False,
  17. loss_weight=3.0),
  18. loss_cls=dict(
  19. type='FocalLoss',
  20. use_sigmoid=True,
  21. gamma=2.0,
  22. alpha=0.25,
  23. loss_weight=1.0),
  24. norm_cfg=dict(type='GN', num_groups=32, requires_grad=True)))
  25. train_pipeline = [
  26. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  27. dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
  28. dict(
  29. type='RandomChoiceResize',
  30. scales=[(852, 512), (852, 480), (852, 448), (852, 416), (852, 384),
  31. (852, 352)],
  32. keep_ratio=True),
  33. dict(type='RandomFlip', prob=0.5),
  34. dict(type='PackDetInputs')
  35. ]
  36. test_pipeline = [
  37. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  38. dict(type='Resize', scale=(852, 512), keep_ratio=True),
  39. dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
  40. dict(
  41. type='PackDetInputs',
  42. meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
  43. 'scale_factor'))
  44. ]
  45. train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
  46. val_dataloader = dict(dataset=dict(pipeline=test_pipeline))
  47. test_dataloader = val_dataloader