solov2_r50_fpn_1x_coco.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. _base_ = [
  2. '../_base_/datasets/coco_instance.py',
  3. '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
  4. ]
  5. # model settings
  6. model = dict(
  7. type='SOLOv2',
  8. data_preprocessor=dict(
  9. type='DetDataPreprocessor',
  10. mean=[123.675, 116.28, 103.53],
  11. std=[58.395, 57.12, 57.375],
  12. bgr_to_rgb=True,
  13. pad_mask=True,
  14. pad_size_divisor=32),
  15. backbone=dict(
  16. type='ResNet',
  17. depth=50,
  18. num_stages=4,
  19. out_indices=(0, 1, 2, 3),
  20. frozen_stages=1,
  21. init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50'),
  22. style='pytorch'),
  23. neck=dict(
  24. type='FPN',
  25. in_channels=[256, 512, 1024, 2048],
  26. out_channels=256,
  27. start_level=0,
  28. num_outs=5),
  29. mask_head=dict(
  30. type='SOLOV2Head',
  31. num_classes=80,
  32. in_channels=256,
  33. feat_channels=512,
  34. stacked_convs=4,
  35. strides=[8, 8, 16, 32, 32],
  36. scale_ranges=((1, 96), (48, 192), (96, 384), (192, 768), (384, 2048)),
  37. pos_scale=0.2,
  38. num_grids=[40, 36, 24, 16, 12],
  39. cls_down_index=0,
  40. mask_feature_head=dict(
  41. feat_channels=128,
  42. start_level=0,
  43. end_level=3,
  44. out_channels=256,
  45. mask_stride=4,
  46. norm_cfg=dict(type='GN', num_groups=32, requires_grad=True)),
  47. loss_mask=dict(type='DiceLoss', use_sigmoid=True, loss_weight=3.0),
  48. loss_cls=dict(
  49. type='FocalLoss',
  50. use_sigmoid=True,
  51. gamma=2.0,
  52. alpha=0.25,
  53. loss_weight=1.0)),
  54. # model training and testing settings
  55. test_cfg=dict(
  56. nms_pre=500,
  57. score_thr=0.1,
  58. mask_thr=0.5,
  59. filter_thr=0.05,
  60. kernel='gaussian', # gaussian/linear
  61. sigma=2.0,
  62. max_per_img=100))
  63. # optimizer
  64. optim_wrapper = dict(
  65. optimizer=dict(lr=0.01), clip_grad=dict(max_norm=35, norm_type=2))
  66. val_evaluator = dict(metric='segm')
  67. test_evaluator = val_evaluator