yolox_tiny_8xb8-300e_coco.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. _base_ = './yolox_s_8xb8-300e_coco.py'
  2. # model settings
  3. model = dict(
  4. data_preprocessor=dict(batch_augments=[
  5. dict(
  6. type='BatchSyncRandomResize',
  7. random_size_range=(320, 640),
  8. size_divisor=32,
  9. interval=10)
  10. ]),
  11. backbone=dict(deepen_factor=0.33, widen_factor=0.375),
  12. neck=dict(in_channels=[96, 192, 384], out_channels=96),
  13. bbox_head=dict(in_channels=96, feat_channels=96))
  14. img_scale = (640, 640) # width, height
  15. train_pipeline = [
  16. dict(type='Mosaic', img_scale=img_scale, pad_val=114.0),
  17. dict(
  18. type='RandomAffine',
  19. scaling_ratio_range=(0.5, 1.5),
  20. # img_scale is (width, height)
  21. border=(-img_scale[0] // 2, -img_scale[1] // 2)),
  22. dict(type='YOLOXHSVRandomAug'),
  23. dict(type='RandomFlip', prob=0.5),
  24. # Resize and Pad are for the last 15 epochs when Mosaic and
  25. # RandomAffine are closed by YOLOXModeSwitchHook.
  26. dict(type='Resize', scale=img_scale, keep_ratio=True),
  27. dict(
  28. type='Pad',
  29. pad_to_square=True,
  30. pad_val=dict(img=(114.0, 114.0, 114.0))),
  31. dict(type='FilterAnnotations', min_gt_bbox_wh=(1, 1), keep_empty=False),
  32. dict(type='PackDetInputs')
  33. ]
  34. test_pipeline = [
  35. dict(type='LoadImageFromFile', backend_args={{_base_.backend_args}}),
  36. dict(type='Resize', scale=(416, 416), keep_ratio=True),
  37. dict(
  38. type='Pad',
  39. pad_to_square=True,
  40. pad_val=dict(img=(114.0, 114.0, 114.0))),
  41. dict(type='LoadAnnotations', with_bbox=True),
  42. dict(
  43. type='PackDetInputs',
  44. meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape',
  45. 'scale_factor'))
  46. ]
  47. train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
  48. val_dataloader = dict(dataset=dict(pipeline=test_pipeline))
  49. test_dataloader = val_dataloader