pyiqa.archs.topiq_arch ====================== .. py:module:: pyiqa.archs.topiq_arch .. autoapi-nested-parse:: TOP-IQ metric, proposed by TOPIQ: A Top-down Approach from Semantics to Distortions for Image Quality Assessment. Chaofeng Chen, Jiadi Mo, Jingwen Hou, Haoning Wu, Liang Liao, Wenxiu Sun, Qiong Yan, Weisi Lin. Transactions on Image Processing, 2024. Paper link: https://arxiv.org/abs/2308.03060 Module Contents --------------- .. py:data:: default_model_urls .. py:class:: TransformerEncoderLayer(d_model, nhead, dim_feedforward=2048, dropout=0.1, activation='gelu', normalize_before=False) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(src) .. py:class:: TransformerDecoderLayer(d_model, nhead, dim_feedforward=2048, dropout=0.1, activation='gelu', normalize_before=False) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(tgt, memory) .. py:class:: TransformerEncoder(encoder_layer, num_layers) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(src) .. py:class:: TransformerDecoder(decoder_layer, num_layers) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(tgt, memory) .. py:class:: GatedConv(weightdim, ksz=3) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(x) .. py:class:: CFANet(semantic_model_name='resnet50', model_name='cfanet_nr_koniq_res50', backbone_pretrain=True, in_size=None, use_ref=True, num_class=1, num_crop=1, crop_size=256, inter_dim=256, num_heads=4, num_attn_layers=1, dprate=0.1, activation='gelu', pretrained=True, pretrained_model_path=None, out_act=False, block_pool='weighted_avg', test_img_size=None, align_crop_face=True, default_mean=IMAGENET_DEFAULT_MEAN, default_std=IMAGENET_DEFAULT_STD) Bases: :py:obj:`torch.nn.Module` .. py:method:: preprocess(x) .. py:method:: fix_bn(model) .. py:method:: get_swin_feature(model, x) .. py:method:: dist_func(x, y, eps=1e-12) .. py:method:: forward_cross_attention(x, y=None) .. py:method:: preprocess_face(x) .. py:method:: forward(x, y=None, return_mos=True, return_dist=False)