pyiqa.archs.liqe_arch

LIQE Model

github repo link: https://github.com/zwx8981/LIQE

Cite as: @inproceedings{zhang2023liqe,

title={Blind Image Quality Assessment via Vision-Language Correspondence: A Multitask Learning Perspective}, author={Zhang, Weixia and Zhai, Guangtao and Wei, Ying and Yang, Xiaokang and Ma, Kede}, booktitle={IEEE/CVF Conference on Computer Vision and Pattern Recognition}, pages={14071–14081}, year={2023}

}

Module Contents

pyiqa.archs.liqe_arch.qualitys = ['bad', 'poor', 'fair', 'good', 'perfect'][source]
pyiqa.archs.liqe_arch.scenes = ['animal', 'cityscape', 'human', 'indoor', 'landscape', 'night', 'plant', 'still_life', 'others'][source]
pyiqa.archs.liqe_arch.dists_map = ['jpeg2000 compression', 'jpeg compression', 'noise', 'blur', 'color', 'contrast',...[source]
pyiqa.archs.liqe_arch.default_model_urls[source]
class pyiqa.archs.liqe_arch.LIQE(model_type='liqe', backbone='ViT-B/32', step=32, num_patch=15, pretrained=True, pretrained_model_path=None, mtl=False)[source]

Bases: torch.nn.Module

LIQE no-reference quality predictor based on CLIP text-image matching.

Parameters:
  • model_type (str) – Output type name for compatibility.

  • backbone (str) – CLIP backbone. Only 'ViT-B/32' is supported.

  • step (int) – Sliding stride for 224x224 patch extraction.

  • num_patch (int) – Number of selected patches per image.

  • pretrained (bool | str) – Whether to load pretrained weights. When set to 'mix', the multitask checkpoint is used.

  • pretrained_model_path (str | None) – Optional local checkpoint path.

  • mtl (bool) – Whether to enable multitask (quality/scene/distortion) text prompts.

get_text_features(x)[source]

Encode and normalize text features for prompt set.

forward(x)[source]

Predict LIQE quality score.

Parameters:

x (torch.Tensor) – Input tensor with shape (N, 3, H, W).

Returns:

Predicted quality scores with shape (N, 1).

Return type:

torch.Tensor

Raises:

AssertionError – If the short image side is smaller than 224.