ssj_scp_270k_coco-instance.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. _base_ = 'ssj_270k_coco-instance.py'
  2. # dataset settings
  3. dataset_type = 'CocoDataset'
  4. data_root = 'data/coco/'
  5. image_size = (1024, 1024)
  6. # Example to use different file client
  7. # Method 1: simply set the data root and let the file I/O module
  8. # automatically infer from prefix (not support LMDB and Memcache yet)
  9. # data_root = 's3://openmmlab/datasets/detection/coco/'
  10. # Method 2: Use `backend_args`, `file_client_args` in versions before 3.0.0rc6
  11. # backend_args = dict(
  12. # backend='petrel',
  13. # path_mapping=dict({
  14. # './data/': 's3://openmmlab/datasets/detection/',
  15. # 'data/': 's3://openmmlab/datasets/detection/'
  16. # }))
  17. backend_args = None
  18. # Standard Scale Jittering (SSJ) resizes and crops an image
  19. # with a resize range of 0.8 to 1.25 of the original image size.
  20. load_pipeline = [
  21. dict(type='LoadImageFromFile', backend_args=backend_args),
  22. dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
  23. dict(
  24. type='RandomResize',
  25. scale=image_size,
  26. ratio_range=(0.8, 1.25),
  27. keep_ratio=True),
  28. dict(
  29. type='RandomCrop',
  30. crop_type='absolute_range',
  31. crop_size=image_size,
  32. recompute_bbox=True,
  33. allow_negative_crop=True),
  34. dict(type='FilterAnnotations', min_gt_bbox_wh=(1e-2, 1e-2)),
  35. dict(type='RandomFlip', prob=0.5),
  36. dict(type='Pad', size=image_size),
  37. ]
  38. train_pipeline = [
  39. dict(type='CopyPaste', max_num_pasted=100),
  40. dict(type='PackDetInputs')
  41. ]
  42. train_dataloader = dict(
  43. dataset=dict(
  44. _delete_=True,
  45. type='MultiImageMixDataset',
  46. dataset=dict(
  47. type=dataset_type,
  48. data_root=data_root,
  49. ann_file='annotations/instances_train2017.json',
  50. data_prefix=dict(img='train2017/'),
  51. filter_cfg=dict(filter_empty_gt=True, min_size=32),
  52. pipeline=load_pipeline,
  53. backend_args=backend_args),
  54. pipeline=train_pipeline))