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.

autoassign_r50_fpn_8x2_1x_coco.py 2.7 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # We follow the original implementation which
  2. # adopts the Caffe pre-trained backbone.
  3. _base_ = [
  4. '../_base_/datasets/coco_detection.py',
  5. '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
  6. ]
  7. model = dict(
  8. type='AutoAssign',
  9. backbone=dict(
  10. type='ResNet',
  11. depth=50,
  12. num_stages=4,
  13. out_indices=(0, 1, 2, 3),
  14. frozen_stages=1,
  15. norm_cfg=dict(type='BN', requires_grad=False),
  16. norm_eval=True,
  17. style='caffe',
  18. init_cfg=dict(
  19. type='Pretrained',
  20. checkpoint='open-mmlab://detectron2/resnet50_caffe')),
  21. neck=dict(
  22. type='FPN',
  23. in_channels=[256, 512, 1024, 2048],
  24. out_channels=256,
  25. start_level=1,
  26. add_extra_convs=True,
  27. num_outs=5,
  28. relu_before_extra_convs=True,
  29. init_cfg=dict(type='Caffe2Xavier', layer='Conv2d')),
  30. bbox_head=dict(
  31. type='AutoAssignHead',
  32. num_classes=80,
  33. in_channels=256,
  34. stacked_convs=4,
  35. feat_channels=256,
  36. strides=[8, 16, 32, 64, 128],
  37. loss_bbox=dict(type='GIoULoss', loss_weight=5.0)),
  38. train_cfg=None,
  39. test_cfg=dict(
  40. nms_pre=1000,
  41. min_bbox_size=0,
  42. score_thr=0.05,
  43. nms=dict(type='nms', iou_threshold=0.6),
  44. max_per_img=100))
  45. img_norm_cfg = dict(
  46. mean=[102.9801, 115.9465, 122.7717], std=[1.0, 1.0, 1.0], to_rgb=False)
  47. train_pipeline = [
  48. dict(type='LoadImageFromFile'),
  49. dict(type='LoadAnnotations', with_bbox=True),
  50. dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
  51. dict(type='RandomFlip', flip_ratio=0.5),
  52. dict(type='Normalize', **img_norm_cfg),
  53. dict(type='Pad', size_divisor=32),
  54. dict(type='DefaultFormatBundle'),
  55. dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
  56. ]
  57. test_pipeline = [
  58. dict(type='LoadImageFromFile'),
  59. dict(
  60. type='MultiScaleFlipAug',
  61. img_scale=(1333, 800),
  62. flip=False,
  63. transforms=[
  64. dict(type='Resize', keep_ratio=True),
  65. dict(type='RandomFlip'),
  66. dict(type='Normalize', **img_norm_cfg),
  67. dict(type='Pad', size_divisor=32),
  68. dict(type='ImageToTensor', keys=['img']),
  69. dict(type='Collect', keys=['img'])
  70. ])
  71. ]
  72. data = dict(
  73. train=dict(pipeline=train_pipeline),
  74. val=dict(pipeline=test_pipeline),
  75. test=dict(pipeline=test_pipeline))
  76. # optimizer
  77. optimizer = dict(lr=0.01, paramwise_cfg=dict(norm_decay_mult=0.))
  78. # learning policy
  79. lr_config = dict(
  80. policy='step',
  81. warmup='linear',
  82. warmup_iters=1000,
  83. warmup_ratio=1.0 / 1000,
  84. step=[8, 11])
  85. total_epochs = 12

No Description

Contributors (1)