pyiqa.archs.dbcnn_arch ====================== .. py:module:: pyiqa.archs.dbcnn_arch .. autoapi-nested-parse:: 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 --------------- .. py:data:: default_model_urls .. py:class:: SCNN(use_bn=True) Bases: :py:obj:`torch.nn.Module` Network branch for synthetic distortions. :param use_bn: Whether to use batch normalization. :type use_bn: bool Modified from https://github.com/zwx8981/DBCNN-PyTorch/blob/master/SCNN.py .. py:method:: forward(X) Forward pass for the SCNN. :param X: Input tensor with shape (N, C, H, W). :type X: torch.Tensor :returns: Output tensor after processing through the network. :rtype: torch.Tensor .. py:class:: 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]) Bases: :py:obj:`torch.nn.Module` Full DBCNN network. :param fc: Whether to initialize the fc layers. :type fc: bool :param use_bn: Whether to use batch normalization. :type use_bn: bool :param pretrained_scnn_path: Pretrained SCNN path. :type pretrained_scnn_path: str :param pretrained: Whether to load pretrained weights. :type pretrained: bool :param pretrained_model_path: Pretrained model path. :type pretrained_model_path: str :param default_mean: Default mean value. :type default_mean: list :param default_std: Default std value. :type default_std: list .. py:method:: preprocess(x) Preprocess the input tensor. :param x: Input tensor with shape (N, C, H, W). :type x: torch.Tensor :returns: Preprocessed tensor. :rtype: torch.Tensor .. py:method:: forward(X) Compute IQA using DBCNN model. :param X: An input tensor with (N, C, H, W) shape. RGB channel order for colour images. :type X: torch.Tensor :returns: Value of DBCNN model. :rtype: torch.Tensor