yolov3_mobilenetv2_8xb24-320-300e_coco.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. _base_ = ['./yolov3_mobilenetv2_8xb24-ms-416-300e_coco.py']
  2. # yapf:disable
  3. model = dict(
  4. bbox_head=dict(
  5. anchor_generator=dict(
  6. base_sizes=[[(220, 125), (128, 222), (264, 266)],
  7. [(35, 87), (102, 96), (60, 170)],
  8. [(10, 15), (24, 36), (72, 42)]])))
  9. # yapf:enable
  10. input_size = (320, 320)
  11. train_pipeline = [
  12. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  13. dict(type='LoadAnnotations', with_bbox=True),
  14. # `mean` and `to_rgb` should be the same with the `preprocess_cfg`
  15. dict(
  16. type='Expand',
  17. mean=[123.675, 116.28, 103.53],
  18. to_rgb=True,
  19. ratio_range=(1, 2)),
  20. dict(
  21. type='MinIoURandomCrop',
  22. min_ious=(0.4, 0.5, 0.6, 0.7, 0.8, 0.9),
  23. min_crop_size=0.3),
  24. dict(type='Resize', scale=input_size, keep_ratio=True),
  25. dict(type='RandomFlip', prob=0.5),
  26. dict(type='PhotoMetricDistortion'),
  27. dict(type='PackDetInputs')
  28. ]
  29. test_pipeline = [
  30. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  31. dict(type='Resize', scale=input_size, keep_ratio=True),
  32. dict(type='LoadAnnotations', with_bbox=True),
  33. dict(
  34. type='PackDetInputs',
  35. meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
  36. 'scale_factor'))
  37. ]
  38. train_dataloader = dict(dataset=dict(dataset=dict(pipeline=train_pipeline)))
  39. val_dataloader = dict(dataset=dict(pipeline=test_pipeline))
  40. test_dataloader = val_dataloader