ssd300.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # model settings
  2. input_size = 300
  3. model = dict(
  4. type='SingleStageDetector',
  5. data_preprocessor=dict(
  6. type='DetDataPreprocessor',
  7. mean=[123.675, 116.28, 103.53],
  8. std=[1, 1, 1],
  9. bgr_to_rgb=True,
  10. pad_size_divisor=1),
  11. backbone=dict(
  12. type='SSDVGG',
  13. depth=16,
  14. with_last_pool=False,
  15. ceil_mode=True,
  16. out_indices=(3, 4),
  17. out_feature_indices=(22, 34),
  18. init_cfg=dict(
  19. type='Pretrained', checkpoint='open-mmlab://vgg16_caffe')),
  20. neck=dict(
  21. type='SSDNeck',
  22. in_channels=(512, 1024),
  23. out_channels=(512, 1024, 512, 256, 256, 256),
  24. level_strides=(2, 2, 1, 1),
  25. level_paddings=(1, 1, 0, 0),
  26. l2_norm_scale=20),
  27. bbox_head=dict(
  28. type='SSDHead',
  29. in_channels=(512, 1024, 512, 256, 256, 256),
  30. num_classes=80,
  31. anchor_generator=dict(
  32. type='SSDAnchorGenerator',
  33. scale_major=False,
  34. input_size=input_size,
  35. basesize_ratio_range=(0.15, 0.9),
  36. strides=[8, 16, 32, 64, 100, 300],
  37. ratios=[[2], [2, 3], [2, 3], [2, 3], [2], [2]]),
  38. bbox_coder=dict(
  39. type='DeltaXYWHBBoxCoder',
  40. target_means=[.0, .0, .0, .0],
  41. target_stds=[0.1, 0.1, 0.2, 0.2])),
  42. # model training and testing settings
  43. train_cfg=dict(
  44. assigner=dict(
  45. type='MaxIoUAssigner',
  46. pos_iou_thr=0.5,
  47. neg_iou_thr=0.5,
  48. min_pos_iou=0.,
  49. ignore_iof_thr=-1,
  50. gt_max_assign_all=False),
  51. sampler=dict(type='PseudoSampler'),
  52. smoothl1_beta=1.,
  53. allowed_border=-1,
  54. pos_weight=-1,
  55. neg_pos_ratio=3,
  56. debug=False),
  57. test_cfg=dict(
  58. nms_pre=1000,
  59. nms=dict(type='nms', iou_threshold=0.45),
  60. min_bbox_size=0,
  61. score_thr=0.02,
  62. max_per_img=200))
  63. cudnn_benchmark = True