pyiqa.archs.liqe_arch ===================== .. py:module:: pyiqa.archs.liqe_arch .. autoapi-nested-parse:: 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 --------------- .. py:data:: qualitys :value: ['bad', 'poor', 'fair', 'good', 'perfect'] .. py:data:: scenes :value: ['animal', 'cityscape', 'human', 'indoor', 'landscape', 'night', 'plant', 'still_life', 'others'] .. py:data:: dists_map :value: ['jpeg2000 compression', 'jpeg compression', 'noise', 'blur', 'color', 'contrast',... .. py:data:: default_model_urls .. py:class:: LIQE(model_type='liqe', backbone='ViT-B/32', step=32, num_patch=15, pretrained=True, pretrained_model_path=None, mtl=False) Bases: :py:obj:`torch.nn.Module` LIQE no-reference quality predictor based on CLIP text-image matching. :param model_type: Output type name for compatibility. :type model_type: str :param backbone: CLIP backbone. Only ``'ViT-B/32'`` is supported. :type backbone: str :param step: Sliding stride for 224x224 patch extraction. :type step: int :param num_patch: Number of selected patches per image. :type num_patch: int :param pretrained: Whether to load pretrained weights. When set to ``'mix'``, the multitask checkpoint is used. :type pretrained: bool | str :param pretrained_model_path: Optional local checkpoint path. :type pretrained_model_path: str | None :param mtl: Whether to enable multitask (quality/scene/distortion) text prompts. :type mtl: bool .. py:method:: get_text_features(x) Encode and normalize text features for prompt set. .. py:method:: forward(x) Predict LIQE quality score. :param x: Input tensor with shape ``(N, 3, H, W)``. :type x: torch.Tensor :returns: Predicted quality scores with shape ``(N, 1)``. :rtype: torch.Tensor :raises AssertionError: If the short image side is smaller than ``224``.