pyiqa.archs.paq2piq_arch

Paq2piq metric, proposed by

Ying, Zhenqiang, Haoran Niu, Praful Gupta, Dhruv Mahajan, Deepti Ghadiyaram, and Alan Bovik. “From patches to pictures (PaQ-2-PiQ): Mapping the perceptual space of picture quality.” In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3575-3585. 2020.

Ref url: https://github.com/baidut/paq2piq/blob/master/paq2piq/model.py Modified by: Chaofeng Chen (https://github.com/chaofengc)

Module Contents

pyiqa.archs.paq2piq_arch.default_model_urls[source]
class pyiqa.archs.paq2piq_arch.AdaptiveConcatPool2d(sz=None)[source]

Bases: torch.nn.Module

Concatenate adaptive max and average pooling outputs.

forward(x)[source]
class pyiqa.archs.paq2piq_arch.PAQ2PIQ(backbone='resnet18', pretrained=True, pretrained_model_path=None)[source]

Bases: torch.nn.Module

PaQ-2-PiQ no-reference image quality predictor.

Parameters:
  • backbone (str) – Backbone name. Currently 'resnet18' is supported.

  • pretrained (bool) – Whether to load pretrained PaQ-2-PiQ weights.

  • pretrained_model_path (str | None) – Optional local checkpoint path.

forward(x)[source]

Predict quality score from image tensor.

Parameters:

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

Returns:

Predicted scores with shape (N, 1).

Return type:

torch.Tensor