nas-fcos_r50-caffe_fpn_fcoshead-gn-head_4xb4-1x_coco.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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='NASFCOS',
  8. data_preprocessor=dict(
  9. type='DetDataPreprocessor',
  10. mean=[103.530, 116.280, 123.675],
  11. std=[1.0, 1.0, 1.0],
  12. bgr_to_rgb=False,
  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=False, eps=0),
  21. style='caffe',
  22. init_cfg=dict(
  23. type='Pretrained',
  24. checkpoint='open-mmlab://detectron2/resnet50_caffe')),
  25. neck=dict(
  26. type='NASFCOS_FPN',
  27. in_channels=[256, 512, 1024, 2048],
  28. out_channels=256,
  29. start_level=1,
  30. add_extra_convs=True,
  31. num_outs=5,
  32. norm_cfg=dict(type='BN'),
  33. conv_cfg=dict(type='DCNv2', deform_groups=2)),
  34. bbox_head=dict(
  35. type='FCOSHead',
  36. num_classes=80,
  37. in_channels=256,
  38. stacked_convs=4,
  39. feat_channels=256,
  40. strides=[8, 16, 32, 64, 128],
  41. norm_cfg=dict(type='GN', num_groups=32),
  42. loss_cls=dict(
  43. type='FocalLoss',
  44. use_sigmoid=True,
  45. gamma=2.0,
  46. alpha=0.25,
  47. loss_weight=1.0),
  48. loss_bbox=dict(type='IoULoss', loss_weight=1.0),
  49. loss_centerness=dict(
  50. type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0)),
  51. train_cfg=dict(
  52. assigner=dict(
  53. type='MaxIoUAssigner',
  54. pos_iou_thr=0.5,
  55. neg_iou_thr=0.4,
  56. min_pos_iou=0,
  57. ignore_iof_thr=-1),
  58. allowed_border=-1,
  59. pos_weight=-1,
  60. debug=False),
  61. test_cfg=dict(
  62. nms_pre=1000,
  63. min_bbox_size=0,
  64. score_thr=0.05,
  65. nms=dict(type='nms', iou_threshold=0.6),
  66. max_per_img=100))
  67. # dataset settings
  68. train_dataloader = dict(batch_size=4, num_workers=2)
  69. # optimizer
  70. optim_wrapper = dict(
  71. optimizer=dict(lr=0.01),
  72. paramwise_cfg=dict(bias_lr_mult=2., bias_decay_mult=0.))