coco.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # -------------------------------------------------------------------------
  2. # Copyright (c) 2021-2022, NVIDIA Corporation & Affiliates. All rights reserved.
  3. #
  4. # This work is made available under the Nvidia Source Code License.
  5. # To view a copy of this license, visit
  6. # https://github.com/NVlabs/GroupViT/blob/main/LICENSE
  7. #
  8. # Written by Jiarui Xu
  9. # -------------------------------------------------------------------------
  10. _base_ = ['../custom_import.py']
  11. # dataset settings
  12. dataset_type = 'COCOObjectDataset'
  13. data_root = 'local_data/coco'
  14. img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
  15. test_pipeline = [
  16. dict(type='LoadImageFromFile'),
  17. dict(
  18. type='MultiScaleFlipAug',
  19. # img_scale=(2048, 512),
  20. img_scale=(2048, 448),
  21. # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
  22. flip=False,
  23. transforms=[
  24. dict(type='Resize', keep_ratio=True),
  25. dict(type='RandomFlip'),
  26. dict(type='Normalize', **img_norm_cfg),
  27. dict(type='ImageToTensor', keys=['img']),
  28. dict(type='Collect', keys=['img']),
  29. ])
  30. ]
  31. data = dict(
  32. test=dict(
  33. type=dataset_type,
  34. data_root=data_root,
  35. img_dir='images/val2017',
  36. ann_dir='annotations/val2017',
  37. pipeline=test_pipeline))
  38. # test_cfg = dict(bg_thresh=.95, mode='whole')
  39. test_cfg = dict(bg_thresh=.95, mode='slide', stride=(224, 224), crop_size=(448, 448))