pyiqa.archs.maniqa_arch ======================= .. py:module:: pyiqa.archs.maniqa_arch .. autoapi-nested-parse:: MANIQA proposed by MANIQA: Multi-dimension Attention Network for No-Reference Image Quality Assessment Sidi Yang, Tianhe Wu, Shuwei Shi, Shanshan Lao, Yuan Gong, Mingdeng Cao, Jiahao Wang and Yujiu Yang. CVPR Workshop 2022, winner of NTIRE2022 NRIQA challenge Reference: - Official github: https://github.com/IIGROUP/MANIQA Module Contents --------------- .. py:data:: default_model_urls .. py:class:: TABlock(dim, drop=0.1) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(x) .. py:class:: SaveOutput .. py:method:: clear() .. py:class:: MANIQA(embed_dim=768, num_outputs=1, patch_size=8, drop=0.1, depths=[2, 2], window_size=4, dim_mlp=768, num_heads=[4, 4], img_size=224, num_tab=2, scale=0.13, test_sample=20, pretrained=True, pretrained_model_path=None, train_dataset='pipal', default_mean=None, default_std=None, **kwargs) Bases: :py:obj:`torch.nn.Module` Implementation of the MANIQA model for image quality assessment. :param - embed_dim: Embedding dimension for the model. Default is 768. :type - embed_dim: int :param - num_outputs: Number of output scores. Default is 1. :type - num_outputs: int :param - patch_size: Size of patches for the model. Default is 8. :type - patch_size: int :param - drop: Dropout rate for the model. Default is 0.1. :type - drop: float :param - depths: List of depths for the Swin Transformer blocks. Default is [2, 2]. :type - depths: list :param - window_size: Window size for the Swin Transformer blocks. Default is 4. :type - window_size: int :param - dim_mlp: Dimension of the MLP for the Swin Transformer blocks. Default is 768. :type - dim_mlp: int :param - num_heads: List of number of heads for the Swin Transformer blocks. Default is [4, 4]. :type - num_heads: list :param - img_size: Size of the input image. Default is 224. :type - img_size: int :param - num_tab: Number of TA blocks for the model. Default is 2. :type - num_tab: int :param - scale: Scale for the Swin Transformer blocks. Default is 0.13. :type - scale: float :param - test_sample: Number of test samples for the model. Default is 20. :type - test_sample: int :param - pretrained: Whether to use a pretrained model. Default is True. :type - pretrained: bool :param - pretrained_model_path: Path to the pretrained model. Default is None. :type - pretrained_model_path: str :param - train_dataset: Name of the training dataset. Default is 'pipal'. :type - train_dataset: str :param - default_mean: Default mean for the model. Default is None. :type - default_mean: torch.Tensor :param - default_std: Default standard deviation for the model. Default is None. :type - default_std: torch.Tensor :returns: Predicted quality score for the input image. :rtype: torch.Tensor .. py:method:: extract_feature(save_output) .. py:method:: forward(x) Forward pass of the MANIQA model. :param x: Input image tensor. :type x: torch.Tensor :returns: Predicted quality score for the input image. :rtype: torch.Tensor