coco.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. # Modified by Jilan Xu
  14. # -------------------------------------------------------------------------
  15. _base_ = ['../custom_import.py']
  16. # dataset settings
  17. dataset_type = 'COCOObjectDataset'
  18. data_root = '/mnt/petrelfs/xujilan/data/coco/'
  19. img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
  20. test_pipeline = [
  21. dict(type='LoadImageFromFile'),
  22. dict(
  23. type='MultiScaleFlipAug',
  24. # img_scale=(2048, 512),
  25. img_scale=(2048, 448),
  26. # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
  27. flip=False,
  28. transforms=[
  29. dict(type='Resize', keep_ratio=True),
  30. dict(type='RandomFlip'),
  31. dict(type='Normalize', **img_norm_cfg),
  32. dict(type='ImageToTensor', keys=['img']),
  33. dict(type='Collect', keys=['img']),
  34. ])
  35. ]
  36. data = dict(
  37. test=dict(
  38. type=dataset_type,
  39. data_root=data_root,
  40. img_dir='images/val2017',
  41. ann_dir='annotations/val2017_cocoobject',
  42. pipeline=test_pipeline))
  43. test_cfg = dict(bg_thresh=.9, mode='slide', stride=(224, 224), crop_size=(448, 448))