boxinst_r50_fpn_ms-90k_coco.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. _base_ = '../common/ms-90k_coco.py'
  2. # model settings
  3. model = dict(
  4. type='BoxInst',
  5. data_preprocessor=dict(
  6. type='BoxInstDataPreprocessor',
  7. mean=[123.675, 116.28, 103.53],
  8. std=[58.395, 57.12, 57.375],
  9. bgr_to_rgb=True,
  10. pad_size_divisor=32,
  11. mask_stride=4,
  12. pairwise_size=3,
  13. pairwise_dilation=2,
  14. pairwise_color_thresh=0.3,
  15. bottom_pixels_removed=10),
  16. backbone=dict(
  17. type='ResNet',
  18. depth=50,
  19. num_stages=4,
  20. out_indices=(0, 1, 2, 3),
  21. frozen_stages=1,
  22. norm_cfg=dict(type='BN', requires_grad=True),
  23. norm_eval=True,
  24. init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50'),
  25. style='pytorch'),
  26. neck=dict(
  27. type='FPN',
  28. in_channels=[256, 512, 1024, 2048],
  29. out_channels=256,
  30. start_level=1,
  31. add_extra_convs='on_output', # use P5
  32. num_outs=5,
  33. relu_before_extra_convs=True),
  34. bbox_head=dict(
  35. type='BoxInstBboxHead',
  36. num_params=593,
  37. num_classes=80,
  38. in_channels=256,
  39. stacked_convs=4,
  40. feat_channels=256,
  41. strides=[8, 16, 32, 64, 128],
  42. norm_on_bbox=True,
  43. centerness_on_reg=True,
  44. dcn_on_last_conv=False,
  45. center_sampling=True,
  46. conv_bias=True,
  47. loss_cls=dict(
  48. type='FocalLoss',
  49. use_sigmoid=True,
  50. gamma=2.0,
  51. alpha=0.25,
  52. loss_weight=1.0),
  53. loss_bbox=dict(type='GIoULoss', loss_weight=1.0),
  54. loss_centerness=dict(
  55. type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0)),
  56. mask_head=dict(
  57. type='BoxInstMaskHead',
  58. num_layers=3,
  59. feat_channels=16,
  60. size_of_interest=8,
  61. mask_out_stride=4,
  62. topk_masks_per_img=64,
  63. mask_feature_head=dict(
  64. in_channels=256,
  65. feat_channels=128,
  66. start_level=0,
  67. end_level=2,
  68. out_channels=16,
  69. mask_stride=8,
  70. num_stacked_convs=4,
  71. norm_cfg=dict(type='BN', requires_grad=True)),
  72. loss_mask=dict(
  73. type='DiceLoss',
  74. use_sigmoid=True,
  75. activate=True,
  76. eps=5e-6,
  77. loss_weight=1.0)),
  78. # model training and testing settings
  79. test_cfg=dict(
  80. nms_pre=1000,
  81. min_bbox_size=0,
  82. score_thr=0.05,
  83. nms=dict(type='nms', iou_threshold=0.6),
  84. max_per_img=100,
  85. mask_thr=0.5))
  86. # optimizer
  87. optim_wrapper = dict(optimizer=dict(lr=0.01))
  88. # evaluator
  89. val_evaluator = dict(metric=['bbox', 'segm'])
  90. test_evaluator = val_evaluator