ssd512_coco.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. _base_ = 'ssd300_coco.py'
  2. # model settings
  3. input_size = 512
  4. model = dict(
  5. neck=dict(
  6. out_channels=(512, 1024, 512, 256, 256, 256, 256),
  7. level_strides=(2, 2, 2, 2, 1),
  8. level_paddings=(1, 1, 1, 1, 1),
  9. last_kernel_size=4),
  10. bbox_head=dict(
  11. in_channels=(512, 1024, 512, 256, 256, 256, 256),
  12. anchor_generator=dict(
  13. type='SSDAnchorGenerator',
  14. scale_major=False,
  15. input_size=input_size,
  16. basesize_ratio_range=(0.1, 0.9),
  17. strides=[8, 16, 32, 64, 128, 256, 512],
  18. ratios=[[2], [2, 3], [2, 3], [2, 3], [2, 3], [2], [2]])))
  19. # dataset settings
  20. train_pipeline = [
  21. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  22. dict(type='LoadAnnotations', with_bbox=True),
  23. dict(
  24. type='Expand',
  25. mean={{_base_.model.data_preprocessor.mean}},
  26. to_rgb={{_base_.model.data_preprocessor.bgr_to_rgb}},
  27. ratio_range=(1, 4)),
  28. dict(
  29. type='MinIoURandomCrop',
  30. min_ious=(0.1, 0.3, 0.5, 0.7, 0.9),
  31. min_crop_size=0.3),
  32. dict(type='Resize', scale=(input_size, input_size), keep_ratio=False),
  33. dict(type='RandomFlip', prob=0.5),
  34. dict(
  35. type='PhotoMetricDistortion',
  36. brightness_delta=32,
  37. contrast_range=(0.5, 1.5),
  38. saturation_range=(0.5, 1.5),
  39. hue_delta=18),
  40. dict(type='PackDetInputs')
  41. ]
  42. test_pipeline = [
  43. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  44. dict(type='Resize', scale=(input_size, input_size), keep_ratio=False),
  45. dict(type='LoadAnnotations', with_bbox=True),
  46. dict(
  47. type='PackDetInputs',
  48. meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
  49. 'scale_factor'))
  50. ]
  51. train_dataloader = dict(dataset=dict(dataset=dict(pipeline=train_pipeline)))
  52. val_dataloader = dict(dataset=dict(pipeline=test_pipeline))
  53. test_dataloader = val_dataloader
  54. # NOTE: `auto_scale_lr` is for automatically scaling LR,
  55. # USER SHOULD NOT CHANGE ITS VALUES.
  56. # base_batch_size = (8 GPUs) x (8 samples per GPU)
  57. auto_scale_lr = dict(base_batch_size=64)