You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_formatting.py 786 B

2 years ago
123456789101112131415161718192021222324
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. import os.path as osp
  3. from mmcv.utils import build_from_cfg
  4. from mmdet.datasets.builder import PIPELINES
  5. def test_default_format_bundle():
  6. results = dict(
  7. img_prefix=osp.join(osp.dirname(__file__), '../../data'),
  8. img_info=dict(filename='color.jpg'))
  9. load = dict(type='LoadImageFromFile')
  10. load = build_from_cfg(load, PIPELINES)
  11. bundle = dict(type='DefaultFormatBundle')
  12. bundle = build_from_cfg(bundle, PIPELINES)
  13. results = load(results)
  14. assert 'pad_shape' not in results
  15. assert 'scale_factor' not in results
  16. assert 'img_norm_cfg' not in results
  17. results = bundle(results)
  18. assert 'pad_shape' in results
  19. assert 'scale_factor' in results
  20. assert 'img_norm_cfg' in results

No Description

Contributors (1)