pyiqa.matlab_utils.resize ========================= .. py:module:: pyiqa.matlab_utils.resize .. autoapi-nested-parse:: A standalone PyTorch implementation for fast and efficient bicubic resampling. The resulting values are the same to MATLAB function imresize('bicubic'). ## Author: Sanghyun Son ## Email: sonsang35@gmail.com (primary), thstkdgus35@snu.ac.kr (secondary) ## Version: 1.2.0 ## Last update: July 9th, 2020 (KST) Dependency: torch Example:: >>> import torch >>> import core >>> x = torch.arange(16).float().view(1, 1, 4, 4) >>> y = core.imresize(x, sizes=(3, 3)) >>> print(y) tensor([[[[ 0.7506, 2.1004, 3.4503], [ 6.1505, 7.5000, 8.8499], [11.5497, 12.8996, 14.2494]]]]) Module Contents --------------- .. py:function:: imresize(x: torch.Tensor, scale: Optional[float] = None, sizes: Optional[Tuple[int, int]] = None, kernel: Union[str, torch.Tensor] = 'cubic', sigma: float = 2, rotation_degree: float = 0, padding_type: str = 'reflect', antialiasing: bool = True) -> torch.Tensor :param x: :type x: torch.Tensor :param scale: :type scale: float :param sizes: :type sizes: tuple(int, int) :param kernel: :type kernel: str, default='cubic' :param sigma: :type sigma: float, default=2 :param rotation_degree: :type rotation_degree: float, default=0 :param padding_type: :type padding_type: str, default='reflect' :param antialiasing: :type antialiasing: bool, default=True :rtype: torch.Tensor