pyiqa.archs.msswd_arch¶
Perceptual color difference metric, MS-SWD.
- @inproceedings{he2024ms-swd,
title={Multiscale Sliced {Wasserstein} Distances as Perceptual Color Difference Measures}, author={He, Jiaqi and Wang, Zhihua and Wang, Leon and Liu, Tsein-I and Fang, Yuming and Sun, Qilin and Ma, Kede}, booktitle={European Conference on Computer Vision}, pages={1–18}, year={2024}, url={http://arxiv.org/abs/2407.10181}
}
- Reference:
Official github: https://github.com/real-hjq/MS-SWD
Module Contents¶
- pyiqa.archs.msswd_arch.color_space_transform(input_color, fromSpace2toSpace)[source]¶
Transform color tensors between supported color spaces.
- Parameters:
input_color (torch.Tensor) – Color tensor with shape
(N, C, H, W).fromSpace2toSpace (str) – Conversion key, for example
'srgb2lab'.
- Returns:
Transformed tensor with shape
(N, C, H, W).- Return type:
torch.Tensor
- Raises:
ValueError – If the conversion key is not defined.
- class pyiqa.archs.msswd_arch.MS_SWD_learned(resize_input: bool = True, pretrained: bool = True, pretrained_model_path: str = None, **kwargs)[source]¶
Bases:
torch.nn.ModuleMS-SWD perceptual color difference metric.
- Parameters:
resize_input (bool) – Whether to resize inputs with short side larger than
256before scoring.pretrained (bool) – Whether to load pretrained weights.
pretrained_model_path (str | None) – Optional local checkpoint path.
**kwargs – Reserved compatibility arguments.