paa_r50_fpn_1x_coco.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. _base_ = [
  2. '../_base_/datasets/coco_detection.py',
  3. '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
  4. ]
  5. # model settings
  6. model = dict(
  7. type='PAA',
  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_size_divisor=32),
  14. backbone=dict(
  15. type='ResNet',
  16. depth=50,
  17. num_stages=4,
  18. out_indices=(0, 1, 2, 3),
  19. frozen_stages=1,
  20. norm_cfg=dict(type='BN', requires_grad=True),
  21. norm_eval=True,
  22. style='pytorch',
  23. init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')),
  24. neck=dict(
  25. type='FPN',
  26. in_channels=[256, 512, 1024, 2048],
  27. out_channels=256,
  28. start_level=1,
  29. add_extra_convs='on_output',
  30. num_outs=5),
  31. bbox_head=dict(
  32. type='PAAHead',
  33. reg_decoded_bbox=True,
  34. score_voting=True,
  35. topk=9,
  36. num_classes=80,
  37. in_channels=256,
  38. stacked_convs=4,
  39. feat_channels=256,
  40. anchor_generator=dict(
  41. type='AnchorGenerator',
  42. ratios=[1.0],
  43. octave_base_scale=8,
  44. scales_per_octave=1,
  45. strides=[8, 16, 32, 64, 128]),
  46. bbox_coder=dict(
  47. type='DeltaXYWHBBoxCoder',
  48. target_means=[.0, .0, .0, .0],
  49. target_stds=[0.1, 0.1, 0.2, 0.2]),
  50. loss_cls=dict(
  51. type='FocalLoss',
  52. use_sigmoid=True,
  53. gamma=2.0,
  54. alpha=0.25,
  55. loss_weight=1.0),
  56. loss_bbox=dict(type='GIoULoss', loss_weight=1.3),
  57. loss_centerness=dict(
  58. type='CrossEntropyLoss', use_sigmoid=True, loss_weight=0.5)),
  59. # training and testing settings
  60. train_cfg=dict(
  61. assigner=dict(
  62. type='MaxIoUAssigner',
  63. pos_iou_thr=0.1,
  64. neg_iou_thr=0.1,
  65. min_pos_iou=0,
  66. ignore_iof_thr=-1),
  67. allowed_border=-1,
  68. pos_weight=-1,
  69. debug=False),
  70. test_cfg=dict(
  71. nms_pre=1000,
  72. min_bbox_size=0,
  73. score_thr=0.05,
  74. nms=dict(type='nms', iou_threshold=0.6),
  75. max_per_img=100))
  76. # optimizer
  77. optim_wrapper = dict(
  78. type='OptimWrapper',
  79. optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001))