pyiqa.archs.nlpd_arch ===================== .. py:module:: pyiqa.archs.nlpd_arch .. autoapi-nested-parse:: 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 --------------- .. py:data:: LAPLACIAN_FILTER .. py:class:: NLPD(channels=1, test_y_channel=True, k=6, filt=None) Bases: :py:obj:`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. .. rubric:: 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. .. py:method:: DN_filters() Define parameters for the divisive normalization .. py:method:: pyramid(im) Compute Laplacian Pyramid :param im: An input tensor. Shape :math:`(N, C, H, W)`. .. py:method:: nlpd(x1, x2) Compute Normalised lapalcian pyramid distance for a batch of images. :param x1: An input tensor. Shape :math:`(N, C, H, W)`. :param x2: A target tensor. Shape :math:`(N, C, H, W)`. :returns: Index of similarity between two images. Usually in [0, 1] interval. .. py:method:: forward(X, Y) Computation of NLPD metric. :param X: An input tensor. Shape :math:`(N, C, H, W)`. :param Y: A target tensor. Shape :math:`(N, C, H, W)`. :returns: Value of NLPD metric in [0, 1] range.