pyiqa.archs.hypernet_arch ========================= .. py:module:: pyiqa.archs.hypernet_arch .. autoapi-nested-parse:: 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 --------------- .. py:data:: default_model_urls .. py:class:: 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]) Bases: :py:obj:`torch.nn.Module` HyperIQA self-adaptive hyper network for no-reference IQA. :param base_model_name: Backbone model name supported by :mod:`timm`. :type base_model_name: str :param num_crop: Number of test-time crops for inference averaging. :type num_crop: int :param pretrained: Whether to load pretrained HyperIQA weights. :type pretrained: bool :param pretrained_model_path: Optional local checkpoint path. :type pretrained_model_path: str | None :param default_mean: Input normalization mean. :type default_mean: list[float] :param default_std: Input normalization std. :type default_std: list[float] 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. .. py:method:: preprocess(x) Resize to 224x224 if needed and apply ImageNet normalization. .. py:method:: forward_patch(x) Predict quality for one 224x224 patch batch. .. py:method:: forward(x) Compute HyperNet quality score. :param x: Distorted image tensor with shape ``(N, 3, H, W)``. :type x: torch.Tensor :returns: Predicted quality score tensor with shape ``(N, 1)``. :rtype: torch.Tensor