pyiqa.archs.maniqa_arch

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:

Module Contents

pyiqa.archs.maniqa_arch.default_model_urls[source]
class pyiqa.archs.maniqa_arch.TABlock(dim, drop=0.1)[source]

Bases: torch.nn.Module

forward(x)[source]
class pyiqa.archs.maniqa_arch.SaveOutput[source]
clear()[source]
class pyiqa.archs.maniqa_arch.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)[source]

Bases: torch.nn.Module

Implementation of the MANIQA model for image quality assessment.

Parameters:
  • embed_dim (-) – Embedding dimension for the model. Default is 768.

  • num_outputs (-) – Number of output scores. Default is 1.

  • patch_size (-) – Size of patches for the model. Default is 8.

  • drop (-) – Dropout rate for the model. Default is 0.1.

  • depths (-) – List of depths for the Swin Transformer blocks. Default is [2, 2].

  • window_size (-) – Window size for the Swin Transformer blocks. Default is 4.

  • dim_mlp (-) – Dimension of the MLP for the Swin Transformer blocks. Default is 768.

  • num_heads (-) – List of number of heads for the Swin Transformer blocks. Default is [4, 4].

  • img_size (-) – Size of the input image. Default is 224.

  • num_tab (-) – Number of TA blocks for the model. Default is 2.

  • scale (-) – Scale for the Swin Transformer blocks. Default is 0.13.

  • test_sample (-) – Number of test samples for the model. Default is 20.

  • pretrained (-) – Whether to use a pretrained model. Default is True.

  • pretrained_model_path (-) – Path to the pretrained model. Default is None.

  • train_dataset (-) – Name of the training dataset. Default is ‘pipal’.

  • default_mean (-) – Default mean for the model. Default is None.

  • default_std (-) – Default standard deviation for the model. Default is None.

Returns:

Predicted quality score for the input image.

Return type:

torch.Tensor

extract_feature(save_output)[source]
forward(x)[source]

Forward pass of the MANIQA model.

Parameters:

x (torch.Tensor) – Input image tensor.

Returns:

Predicted quality score for the input image.

Return type:

torch.Tensor