pyiqa.archs.pieapp_arch ======================= .. py:module:: pyiqa.archs.pieapp_arch .. autoapi-nested-parse:: PieAPP metric, proposed by Prashnani, Ekta, Hong Cai, Yasamin Mostofi, and Pradeep Sen. "Pieapp: Perceptual image-error assessment through pairwise preference." In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1808-1817. 2018. Ref url: https://github.com/prashnani/PerceptualImageError Modified by: Chaofeng Chen (https://github.com/chaofengc) !!! Important Note: to keep simple test process and fair comparison with other methods, we use zero padding and extract subpatches only once rather than from multiple subimages as the original codes. Module Contents --------------- .. py:data:: default_model_urls .. py:class:: CompactLinear Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(x) .. py:class:: PieAPP(patch_size=64, stride=27, pretrained=True, pretrained_model_path=None) Bases: :py:obj:`torch.nn.Module` PieAPP model implementation. :param - patch_size: Size of the patches to extract from the images. :type - patch_size: int :param - stride: Stride to use when extracting patches. :type - stride: int :param - pretrained: Whether to use a pretrained model or not. :type - pretrained: bool :param - pretrained_model_path: Path to the pretrained model. :type - pretrained_model_path: str .. method:: - flatten(matrix) Takes NxCxHxW input and outputs NxHWC. .. method:: compute_features(input) Computes the features of the input image. .. method:: - preprocess(x) Preprocesses the input image. .. method:: forward(dist, ref) Computes the PieAPP score between the distorted and reference images. .. py:method:: flatten(matrix) .. py:method:: compute_features(input) .. py:method:: preprocess(x) Default BGR in [0, 255] in original codes .. py:method:: forward(dist, ref)