pascal_context.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 = 'PascalContextDataset'
  13. data_root = 'local_data/VOCdevkit/VOC2010/'
  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, 448),
  20. # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
  21. flip=False,
  22. transforms=[
  23. dict(type='Resize', keep_ratio=True),
  24. dict(type='RandomFlip'),
  25. dict(type='Normalize', **img_norm_cfg),
  26. dict(type='ImageToTensor', keys=['img']),
  27. dict(type='Collect', keys=['img']),
  28. ])
  29. ]
  30. data = dict(
  31. test=dict(
  32. type=dataset_type,
  33. data_root=data_root,
  34. img_dir='JPEGImages',
  35. ann_dir='SegmentationClassContext',
  36. split='ImageSets/SegmentationContext/val.txt',
  37. pipeline=test_pipeline))
  38. test_cfg = dict(bg_thresh=.35, mode='slide', stride=(224, 224), crop_size=(448, 448))