coco.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # -------------------------------------------------------------------------
  2. # Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
  3. #
  4. # NVIDIA CORPORATION & AFFILIATES and its licensors retain all intellectual
  5. # property and proprietary rights in and to this software, related
  6. # documentation and any modifications thereto. Any use, reproduction,
  7. # disclosure or distribution of this software and related documentation
  8. # without an express license agreement from NVIDIA CORPORATION is strictly
  9. # prohibited.
  10. #
  11. # Written by Jiarui Xu
  12. # -------------------------------------------------------------------------
  13. _base_ = ['../custom_import.py']
  14. # dataset settings
  15. dataset_type = 'COCOObjectDataset'
  16. data_root = 'local_data/coco'
  17. img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
  18. test_pipeline = [
  19. dict(type='LoadImageFromFile'),
  20. dict(
  21. type='MultiScaleFlipAug',
  22. # img_scale=(2048, 512),
  23. img_scale=(2048, 448),
  24. # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
  25. flip=False,
  26. transforms=[
  27. dict(type='Resize', keep_ratio=True),
  28. dict(type='RandomFlip'),
  29. dict(type='Normalize', **img_norm_cfg),
  30. dict(type='ImageToTensor', keys=['img']),
  31. dict(type='Collect', keys=['img']),
  32. ])
  33. ]
  34. data = dict(
  35. test=dict(
  36. type=dataset_type,
  37. data_root=data_root,
  38. img_dir='images/val2017',
  39. ann_dir='annotations/val2017',
  40. pipeline=test_pipeline))
  41. # test_cfg = dict(bg_thresh=.95, mode='whole')
  42. test_cfg = dict(bg_thresh=.95, mode='slide', stride=(224, 224), crop_size=(448, 448))