ade20k_semantic.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. dataset_type = 'ADE20KSegDataset'
  2. data_root = 'data/ADEChallengeData2016/'
  3. # Example to use different file client
  4. # Method 1: simply set the data root and let the file I/O module
  5. # automatically infer from prefix (not support LMDB and Memcache yet)
  6. # data_root = 's3://openmmlab/datasets/detection/ADEChallengeData2016/'
  7. # Method 2: Use `backend_args`, `file_client_args` in versions before 3.0.0rc6
  8. # backend_args = dict(
  9. # backend='petrel',
  10. # path_mapping=dict({
  11. # './data/': 's3://openmmlab/datasets/detection/',
  12. # 'data/': 's3://openmmlab/datasets/detection/'
  13. # }))
  14. backend_args = None
  15. test_pipeline = [
  16. dict(type='LoadImageFromFile', backend_args=backend_args),
  17. dict(type='Resize', scale=(2048, 512), keep_ratio=True),
  18. dict(
  19. type='LoadAnnotations',
  20. with_bbox=False,
  21. with_mask=False,
  22. with_seg=True,
  23. reduce_zero_label=True),
  24. dict(
  25. type='PackDetInputs', meta_keys=('img_path', 'ori_shape', 'img_shape'))
  26. ]
  27. val_dataloader = dict(
  28. batch_size=1,
  29. num_workers=2,
  30. persistent_workers=True,
  31. drop_last=False,
  32. sampler=dict(type='DefaultSampler', shuffle=False),
  33. dataset=dict(
  34. type=dataset_type,
  35. data_root=data_root,
  36. data_prefix=dict(
  37. img_path='images/validation',
  38. seg_map_path='annotations/validation'),
  39. pipeline=test_pipeline))
  40. test_dataloader = val_dataloader
  41. val_evaluator = dict(type='SemSegMetric', iou_metrics=['mIoU'])
  42. test_evaluator = val_evaluator