gaussian_blur#

torchaug.transforms.functional.gaussian_blur(img, kernel_size, sigma=None, value_check=False)[source]#

Performs Gaussian blurring on the image by given kernel. If is expected to have […, H, W] shape, where … means an arbitrary number of leading dimensions.

Parameters:
  • img (Tensor) – Image to be blurred.

  • kernel_size (list[int]) –

    Gaussian kernel size. Can be a sequence of integers like (kx, ky) or a single integer for square kernels.

    Note

    In torchscript mode kernel_size as single int is not supported, use a sequence of length 1: [ksize, ].

  • sigma (UnionType[int, float, list[int], list[float], Tensor, None], optional) – Gaussian kernel standard deviation. Can be a sequence of floats like (sigma_x, sigma_y) or a single float to define the same sigma in both X/Y directions. If None, then it is computed using kernel_size as sigma = 0.3 * ((kernel_size - 1) * 0.5 - 1) + 0.8.

    Default: None

  • value_check (bool, optional) – Bool to perform tensor value check. Might cause slow down on some devices because of synchronization.

    Default: False

Return type:

Tensor

Returns:

Gaussian Blurred version of the image.