pyiqa.archs.clipiqa_arch¶
CLIP-IQA metric, proposed by
Exploring CLIP for Assessing the Look and Feel of Images. Jianyi Wang, Kelvin C.K. Chan, Chen Change Loy. AAAI 2023.
Ref url: https://github.com/IceClear/CLIP-IQA Re-implemented by: Chaofeng Chen (https://github.com/chaofengc) with the following modification:
We assemble multiple prompts to improve the results of clipiqa model.
Module Contents¶
- class pyiqa.archs.clipiqa_arch.PromptLearner(clip_model, n_ctx=16)[source]¶
Bases:
torch.nn.ModulePromptLearner class for learning prompts for CLIP-IQA.
- Disclaimer:
This implementation follows exactly the official codes in: https://github.com/IceClear/CLIP-IQA. We have no idea why some tricks are implemented like this, which include:
Using n_ctx prefix characters “X”
Appending extra “.” at the end
Insert the original text embedding at the middle
- class pyiqa.archs.clipiqa_arch.CLIPIQA(model_type='clipiqa', backbone='RN50', pretrained=True, pos_embedding=False)[source]¶
Bases:
torch.nn.ModuleCLIPIQA metric class.
- Parameters:
model_type (str) – The type of the model. Default is ‘clipiqa’.
backbone (str) – The backbone model. Default is ‘RN50’.
pretrained (bool) – Whether to load pretrained weights. Default is True.
pos_embedding (bool) – Whether to use positional embedding. Default is False.