pyiqa.archs.qualiclip_arch

Quality-Aware Image-Text Alignment for Real-World Image Quality Assessment

@article{agnolucci2024qualityaware,

title={Quality-Aware Image-Text Alignment for Real-World Image Quality Assessment}, author={Agnolucci, Lorenzo and Galteri, Leonardo and Bertini, Marco}, journal={arXiv preprint arXiv:2403.11176}, year={2024}

}

Reference:

Module Contents

pyiqa.archs.qualiclip_arch.default_model_urls[source]
class pyiqa.archs.qualiclip_arch.PromptLearner(clip_model, prompt_pairs, n_ctx=16, ctx_init='', prompt_specific_ctx=False)[source]

Bases: torch.nn.Module

PromptLearner class for learning prompts for QualiCLIP+. See https://github.com/IceClear/CLIP-IQA for reference.

get_prompts_with_middle_class()[source]

Get prompts with the original text embedding inserted in the middle.

Returns:

The generated prompts.

Return type:

torch.Tensor

forward(clip_model)[source]

Forward pass for the PromptLearner.

Parameters:

clip_model (nn.Module) – The CLIP model.

Returns:

The output features.

Return type:

torch.Tensor

class pyiqa.archs.qualiclip_arch.QualiCLIP(model_type='qualiclip+', backbone='RN50', temperature=2, n_ctx=16, ctx_init='', prompt_specific_ctx=True, pretrained=True, pos_embedding=False)[source]

Bases: torch.nn.Module

QualiCLIP model implementation following the original paper. QualiCLIP+ represents the version that employs prompt learning, similar to CLIP-IQA+ (https://arxiv.org/abs/2207.12396).

forward(x)[source]