pyiqa.archs.hypernet_arch

HyperNet Metric

@InProceedings{hyperiqa,

author = {Su, Shaolin and Yan, Qingsen and Zhu, Yu and Zhang, Cheng and Ge, Xin and Sun, Jinqiu and Zhang, Yanning}, title = {Blindly Assess Image Quality in the Wild Guided by a Self-Adaptive Hyper Network}, booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, month = {June}, year = {2020}

}

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

Module Contents

pyiqa.archs.hypernet_arch.default_model_urls[source]
class pyiqa.archs.hypernet_arch.HyperNet(base_model_name='resnet50', num_crop=25, 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

HyperIQA self-adaptive hyper network for no-reference IQA.

Parameters:
  • base_model_name (str) – Backbone model name supported by timm.

  • num_crop (int) – Number of test-time crops for inference averaging.

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

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

  • default_mean (list[float]) – Input normalization mean.

  • default_std (list[float]) – Input normalization std.

Reference:

Su, Shaolin, Qingsen Yan, Yu Zhu, Cheng Zhang, Xin Ge, Jinqiu Sun, and Yanning Zhang. “Blindly assess image quality in the wild guided by a self-adaptive hyper network.” In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3667-3676. 2020.

preprocess(x)[source]

Resize to 224x224 if needed and apply ImageNet normalization.

forward_patch(x)[source]

Predict quality for one 224x224 patch batch.

forward(x)[source]

Compute HyperNet quality score.

Parameters:

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

Returns:

Predicted quality score tensor with shape (N, 1).

Return type:

torch.Tensor