solo_r50_fpn_1x_coco.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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='SOLO',
  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='SOLOHead',
  31. num_classes=80,
  32. in_channels=256,
  33. stacked_convs=7,
  34. feat_channels=256,
  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. loss_mask=dict(type='DiceLoss', use_sigmoid=True, loss_weight=3.0),
  41. loss_cls=dict(
  42. type='FocalLoss',
  43. use_sigmoid=True,
  44. gamma=2.0,
  45. alpha=0.25,
  46. loss_weight=1.0),
  47. norm_cfg=dict(type='GN', num_groups=32, requires_grad=True)),
  48. # model training and testing settings
  49. test_cfg=dict(
  50. nms_pre=500,
  51. score_thr=0.1,
  52. mask_thr=0.5,
  53. filter_thr=0.05,
  54. kernel='gaussian', # gaussian/linear
  55. sigma=2.0,
  56. max_per_img=100))
  57. # optimizer
  58. optim_wrapper = dict(optimizer=dict(lr=0.01))
  59. val_evaluator = dict(metric='segm')
  60. test_evaluator = val_evaluator