IQM_Vis.metrics.SSIM package
Submodules
IQM_Vis.metrics.SSIM.ssim module
- IQM_Vis.metrics.SSIM.ssim.gaussian_filter(input: torch.Tensor, win: torch.Tensor) torch.Tensor [source]
Blur input with 1-D kernel :param input: a batch of tensors to be blurred :type input: torch.Tensor :param window: 1-D gauss kernel :type window: torch.Tensor
- Returns
blurred tensors
- Return type
torch.Tensor
- IQM_Vis.metrics.SSIM.ssim.ms_ssim(X: torch.Tensor, Y: torch.Tensor, data_range: float = 255, size_average: bool = True, win_size: int = 11, win_sigma: float = 1.5, win: Optional[torch.Tensor] = None, weights: Optional[List[float]] = None, K: Union[Tuple[float, float], List[float]] = (0.01, 0.03)) torch.Tensor [source]
interface of ms-ssim :param X: a batch of images, (N,C,[T,]H,W) :type X: torch.Tensor :param Y: a batch of images, (N,C,[T,]H,W) :type Y: torch.Tensor :param data_range: value range of input images. (usually 1.0 or 255) :type data_range: float or int, optional :param size_average: if size_average=True, ssim of all images will be averaged as a scalar :type size_average: bool, optional :param win_size: (int, optional): the size of gauss kernel :param win_sigma: (float, optional): sigma of normal distribution :param win: 1-D gauss kernel. if None, a new kernel will be created according to win_size and win_sigma :type win: torch.Tensor, optional :param weights: weights for different levels :type weights: list, optional :param K: scalar constants (K1, K2). Try a larger K2 constant (e.g. 0.4) if you get a negative or NaN results. :type K: list or tuple, optional
- Returns
ms-ssim results
- Return type
torch.Tensor