pyiqa.archs.dmm_arch ==================== .. py:module:: pyiqa.archs.dmm_arch .. autoapi-nested-parse:: Debiased Mapping for Full-Reference Image Quality Assessment @article{chen2025debiased, title={Debiased mapping for full-reference image quality assessment}, author={Chen, Baoliang and Zhu, Hanwei and Zhu, Lingyu and Wang, Shanshe and Pan, Jingshan and Wang, Shiqi}, journal={IEEE Transactions on Multimedia}, year={2025}, publisher={IEEE} } Reference: - Arxiv link: https://ieeexplore.ieee.org/abstract/document/10886996 - Official Github: https://github.com/Baoliang93/DMM Module Contents --------------- .. py:data:: names .. py:class:: FeaturesExtractor(target_features=('relu3_3', 'relu4_3'), use_input_norm=False, requires_grad=False, replace_pooling=True) Bases: :py:obj:`torch.nn.Module` VGG16 feature extractor for DMM. :param target_features: VGG feature names to collect. :type target_features: tuple[str, ...] :param use_input_norm: Whether to apply ImageNet normalization. :type use_input_norm: bool :param requires_grad: Whether extracted backbone parameters are trainable. :type requires_grad: bool :param replace_pooling: Whether to replace max-pooling with L2 pooling. :type replace_pooling: bool .. py:method:: forward(x) Extract configured feature maps from input image tensor. .. py:method:: replace_pooling(module: torch.nn.Module) -> torch.nn.Module .. py:class:: L2Pool2d(kernel_size: int = 3, stride: int = 2, padding=1) Bases: :py:obj:`torch.nn.Module` Applies L2 pooling with Hann window of size 3x3 :param x: Tensor with shape (N, C, H, W) .. py:method:: forward(x: torch.Tensor) -> torch.Tensor Apply L2 pooling using a Hann filter kernel. .. py:class:: DMM(reduce_dim=256, kernel_size=5, features_to_compute=('relu3_3', 'relu4_3'), criterion=torch.nn.CosineSimilarity(), use_dropout=True, **kwargs) Bases: :py:obj:`torch.nn.Module` DMM full-reference IQA model. :param reduce_dim: Reserved compatibility argument. :type reduce_dim: int :param kernel_size: Reserved compatibility argument. :type kernel_size: int :param features_to_compute: Feature names used for DMM. :type features_to_compute: tuple[str, ...] :param criterion: Reserved compatibility argument. :type criterion: torch.nn.Module :param use_dropout: Reserved compatibility argument. :type use_dropout: bool :param \*\*kwargs: Reserved compatibility arguments. .. py:method:: forward(Dist, Ref, as_loss=False) Compute DMM score or training loss. :param Dist: Distorted image tensor ``(N, 3, H, W)``. :type Dist: torch.Tensor :param Ref: Reference image tensor ``(N, 3, H, W)``. :type Ref: torch.Tensor :param as_loss: If ``True``, return mean score for optimization. :type as_loss: bool :returns: Per-sample scores when ``as_loss=False``, otherwise a scalar loss tensor. :rtype: torch.Tensor .. py:method:: prepare_image_adt(tensor_image) Adaptively resize large images for stable patch-based scoring.