pyiqa.archs.ckdn_arch

CKDN model introduced by

Zheng, Heliang, Huan Yang, Jianlong Fu, Zheng-Jun Zha, and Jiebo Luo. “Learning conditional knowledge distillation for degraded-reference image quality assessment.” In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 10242-10251. 2021.

Ref url: https://github.com/researchmm/CKDN. Re-implemented by: Chaofeng Chen (https://github.com/chaofengc)

Module Contents

pyiqa.archs.ckdn_arch.default_model_urls[source]
pyiqa.archs.ckdn_arch.model_urls[source]
pyiqa.archs.ckdn_arch.conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1)[source]

3x3 convolution with padding

pyiqa.archs.ckdn_arch.conv1x1(in_planes, out_planes, stride=1)[source]

1x1 convolution

class pyiqa.archs.ckdn_arch.BasicBlock(inplanes, planes, stride=1, downsample=None, groups=1, base_width=64, dilation=1, norm_layer=None)[source]

Bases: torch.nn.Module

forward(x)[source]
class pyiqa.archs.ckdn_arch.Bottleneck(inplanes, planes, stride=1, downsample=None, groups=1, base_width=64, dilation=1, norm_layer=None)[source]

Bases: torch.nn.Module

forward(x)[source]
class pyiqa.archs.ckdn_arch.ResNet(block, layers, num_classes=1000, zero_init_residual=False, groups=1, width_per_group=64, replace_stride_with_dilation=None, norm_layer=None)[source]

Bases: torch.nn.Module

forward(x, y)[source]

Forward pass for the ResNet model.

Parameters:
  • x (torch.Tensor) – Input tensor with shape (N, C, H, W).

  • y (torch.Tensor) – Reference tensor with shape (N, C, H, W).

Returns:

Output tensor after processing through the network.

Return type:

torch.Tensor

class pyiqa.archs.ckdn_arch.CKDN(pretrained=True, pretrained_model_path=None, use_default_preprocess=True, default_mean=(0.485, 0.456, 0.406), default_std=(0.229, 0.224, 0.225), **kwargs)[source]

Bases: torch.nn.Module

CKDN metric.

Parameters:
  • pretrained_model_path (str) – The model path.

  • use_default_preprocess (bool) – Whether to use default preprocess, default: True.

  • default_mean (tuple) – The mean value.

  • default_std (tuple) – The std value.

Reference:

Zheng, Heliang, Huan Yang, Jianlong Fu, Zheng-Jun Zha, and Jiebo Luo. “Learning conditional knowledge distillation for degraded-reference image quality assessment.” In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 10242-10251. 2021.

forward(x, y)[source]

Compute IQA using CKDN model.

Parameters:
  • x (torch.Tensor) – Input tensor with shape (N, C, H, W). RGB channel order for colour images.

  • y (torch.Tensor) – Reference tensor with shape (N, C, H, W). RGB channel order for colour images.

Returns:

Value of CKDN model.

Return type:

torch.Tensor