pyiqa.archs.nlpd_arch

NLPD Metric

@article{laparra2016nlpd,

title={Perceptual image quality assessment using a normalized Laplacian pyramid}, author={Laparra, Valero and Ball{'e}, Johannes and Berardino, Alexander and Simoncelli, Eero P}, journal={Electronic Imaging}, volume={2016}, number={16}, pages={1–6}, year={2016}, publisher={Society for Imaging Science and Technology}

}

Created by: https://github.com/dingkeyan93/IQA-optimization/blob/master/IQA_pytorch/NLPD.py

Modified by: Jiadi Mo (https://github.com/JiadiMo)

Refer to:

Matlab code from https://www.cns.nyu.edu/~lcv/NLPyr/NLP_dist.m;

Module Contents

pyiqa.archs.nlpd_arch.LAPLACIAN_FILTER[source]
class pyiqa.archs.nlpd_arch.NLPD(channels=1, test_y_channel=True, k=6, filt=None)[source]

Bases: torch.nn.Module

Normalised lapalcian pyramid distance :param - channels: Number of channel expected to calculate. :param - test_y_channel: Boolean, whether to use y channel on ycbcr which mimics official matlab code.

References

Laparra, Valero, Johannes Ballé, Alexander Berardino, and Eero P. Simoncelli. “Perceptual image quality assessment using a normalized Laplacian pyramid.” Electronic Imaging 2016, no. 16 (2016): 1-6.

DN_filters()[source]

Define parameters for the divisive normalization

pyramid(im)[source]

Compute Laplacian Pyramid :param im: An input tensor. Shape \((N, C, H, W)\).

nlpd(x1, x2)[source]

Compute Normalised lapalcian pyramid distance for a batch of images. :param x1: An input tensor. Shape \((N, C, H, W)\). :param x2: A target tensor. Shape \((N, C, H, W)\).

Returns:

Index of similarity between two images. Usually in [0, 1] interval.

forward(X, Y)[source]

Computation of NLPD metric. :param X: An input tensor. Shape \((N, C, H, W)\). :param Y: A target tensor. Shape \((N, C, H, W)\).

Returns:

Value of NLPD metric in [0, 1] range.