Shortcuts

denoising-real_test_config 源代码

# Copyright (c) OpenMMLab. All rights reserved.
from mmengine.dataset import DefaultSampler

from mmagic.datasets import BasicImageDataset
from mmagic.datasets.transforms import LoadImageFromFile, PackInputs
from mmagic.engine.runner import MultiTestLoop
from mmagic.evaluation import PSNR, SSIM

[文档]test_pipeline = [ dict( type=LoadImageFromFile, key='img', color_type='color', channel_order='rgb', imdecode_backend='cv2'), dict( type=LoadImageFromFile, key='gt', color_type='color', channel_order='rgb', imdecode_backend='cv2'), dict(type=PackInputs)
]
[文档]sidd_data_root = 'data/SIDD/val/'
[文档]sidd_dataloader = dict( num_workers=4, persistent_workers=False, drop_last=False, sampler=dict(type=DefaultSampler, shuffle=False), dataset=dict( type=BasicImageDataset, metainfo=dict(dataset_type='SIDD', task_name='denoising'), data_root=sidd_data_root, data_prefix=dict(img='noisy', gt='gt'), filename_tmpl=dict(gt='{}_GT', img='{}_NOISY'), pipeline=test_pipeline))
[文档]sidd_evaluator = [ dict(type=PSNR, prefix='SIDD'), dict(type=SSIM, prefix='SIDD'),
]
[文档]dnd_data_root = 'data/DND'
[文档]dnd_dataloader = dict( num_workers=4, persistent_workers=False, drop_last=False, sampler=dict(type=DefaultSampler, shuffle=False), dataset=dict( type=BasicImageDataset, metainfo=dict(dataset_type='DND', task_name='denoising'), data_root=dnd_data_root, data_prefix=dict(img='input', gt='groundtruth'), pipeline=test_pipeline))
[文档]dnd_evaluator = [ dict(type=PSNR, prefix='DND'), dict(type=SSIM, prefix='DND'),
] # test config
[文档]test_cfg = dict(type=MultiTestLoop)
[文档]test_dataloader = [ sidd_dataloader,
# dnd_dataloader, ]
[文档]test_evaluator = [ sidd_evaluator,
# dnd_dataloader, ]
Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.