You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

centripetalnet_hourglass104_mstest_16x6_210e_coco.py 3.5 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. _base_ = [
  2. '../_base_/default_runtime.py', '../_base_/datasets/coco_detection.py'
  3. ]
  4. # model settings
  5. model = dict(
  6. type='CornerNet',
  7. backbone=dict(
  8. type='HourglassNet',
  9. downsample_times=5,
  10. num_stacks=2,
  11. stage_channels=[256, 256, 384, 384, 384, 512],
  12. stage_blocks=[2, 2, 2, 2, 2, 4],
  13. norm_cfg=dict(type='BN', requires_grad=True)),
  14. neck=None,
  15. bbox_head=dict(
  16. type='CentripetalHead',
  17. num_classes=80,
  18. in_channels=256,
  19. num_feat_levels=2,
  20. corner_emb_channels=0,
  21. loss_heatmap=dict(
  22. type='GaussianFocalLoss', alpha=2.0, gamma=4.0, loss_weight=1),
  23. loss_offset=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1),
  24. loss_guiding_shift=dict(
  25. type='SmoothL1Loss', beta=1.0, loss_weight=0.05),
  26. loss_centripetal_shift=dict(
  27. type='SmoothL1Loss', beta=1.0, loss_weight=1)),
  28. # training and testing settings
  29. train_cfg=None,
  30. test_cfg=dict(
  31. corner_topk=100,
  32. local_maximum_kernel=3,
  33. distance_threshold=0.5,
  34. score_thr=0.05,
  35. max_per_img=100,
  36. nms=dict(type='soft_nms', iou_threshold=0.5, method='gaussian')))
  37. # data settings
  38. img_norm_cfg = dict(
  39. mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
  40. train_pipeline = [
  41. dict(type='LoadImageFromFile', to_float32=True),
  42. dict(type='LoadAnnotations', with_bbox=True),
  43. dict(
  44. type='PhotoMetricDistortion',
  45. brightness_delta=32,
  46. contrast_range=(0.5, 1.5),
  47. saturation_range=(0.5, 1.5),
  48. hue_delta=18),
  49. dict(
  50. type='RandomCenterCropPad',
  51. crop_size=(511, 511),
  52. ratios=(0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3),
  53. test_mode=False,
  54. test_pad_mode=None,
  55. **img_norm_cfg),
  56. dict(type='Resize', img_scale=(511, 511), keep_ratio=False),
  57. dict(type='RandomFlip', flip_ratio=0.5),
  58. dict(type='Normalize', **img_norm_cfg),
  59. dict(type='DefaultFormatBundle'),
  60. dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']),
  61. ]
  62. test_pipeline = [
  63. dict(type='LoadImageFromFile', to_float32=True),
  64. dict(
  65. type='MultiScaleFlipAug',
  66. scale_factor=1.0,
  67. flip=True,
  68. transforms=[
  69. dict(type='Resize'),
  70. dict(
  71. type='RandomCenterCropPad',
  72. crop_size=None,
  73. ratios=None,
  74. border=None,
  75. test_mode=True,
  76. test_pad_mode=['logical_or', 127],
  77. **img_norm_cfg),
  78. dict(type='RandomFlip'),
  79. dict(type='Normalize', **img_norm_cfg),
  80. dict(type='ImageToTensor', keys=['img']),
  81. dict(
  82. type='Collect',
  83. keys=['img'],
  84. meta_keys=('filename', 'ori_shape', 'img_shape', 'pad_shape',
  85. 'scale_factor', 'flip', 'img_norm_cfg', 'border')),
  86. ])
  87. ]
  88. data = dict(
  89. samples_per_gpu=6,
  90. workers_per_gpu=3,
  91. train=dict(pipeline=train_pipeline),
  92. val=dict(pipeline=test_pipeline),
  93. test=dict(pipeline=test_pipeline))
  94. # optimizer
  95. optimizer = dict(type='Adam', lr=0.0005)
  96. optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
  97. # learning policy
  98. lr_config = dict(
  99. policy='step',
  100. warmup='linear',
  101. warmup_iters=500,
  102. warmup_ratio=1.0 / 3,
  103. step=[190])
  104. runner = dict(type='EpochBasedRunner', max_epochs=210)

No Description

Contributors (2)