pyiqa.archs.dbcnn_arch

DBCNN Metric

Reference:

Zhang, Weixia, et al. “Blind image quality assessment using a deep bilinear convolutional neural network.” IEEE Transactions on Circuits and Systems for Video Technology 30.1 (2018): 36-47.

Ref url: https://github.com/zwx8981/DBCNN-PyTorch/blob/master/DBCNN.py Re-implemented by: Chaofeng Chen (https://github.com/chaofengc)

Module Contents

pyiqa.archs.dbcnn_arch.default_model_urls[source]
class pyiqa.archs.dbcnn_arch.SCNN(use_bn=True)[source]

Bases: torch.nn.Module

Network branch for synthetic distortions.

Parameters:

use_bn (bool) – Whether to use batch normalization.

Modified from https://github.com/zwx8981/DBCNN-PyTorch/blob/master/SCNN.py

forward(X)[source]

Forward pass for the SCNN.

Parameters:

X (torch.Tensor) – Input tensor with shape (N, C, H, W).

Returns:

Output tensor after processing through the network.

Return type:

torch.Tensor

class pyiqa.archs.dbcnn_arch.DBCNN(fc=True, use_bn=True, pretrained_scnn_path=None, pretrained=True, pretrained_model_path=None, default_mean=[0.485, 0.456, 0.406], default_std=[0.229, 0.224, 0.225])[source]

Bases: torch.nn.Module

Full DBCNN network.

Parameters:
  • fc (bool) – Whether to initialize the fc layers.

  • use_bn (bool) – Whether to use batch normalization.

  • pretrained_scnn_path (str) – Pretrained SCNN path.

  • pretrained (bool) – Whether to load pretrained weights.

  • pretrained_model_path (str) – Pretrained model path.

  • default_mean (list) – Default mean value.

  • default_std (list) – Default std value.

preprocess(x)[source]

Preprocess the input tensor.

Parameters:

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

Returns:

Preprocessed tensor.

Return type:

torch.Tensor

forward(X)[source]

Compute IQA using DBCNN model.

Parameters:

X (torch.Tensor) – An input tensor with (N, C, H, W) shape. RGB channel order for colour images.

Returns:

Value of DBCNN model.

Return type:

torch.Tensor