batch_gaussian_blur#

torchaug.batch_transforms.functional.batch_gaussian_blur(imgs, kernel_size, sigma=None, value_check=False)[source]#

Performs Gaussian blurring on the batch of images by given kernel. It is expected to have [B, …, C, H, W] shape, where … means an arbitrary number of dimensions.

Parameters:
  • img – Image to be blurred

  • kernel_size (sequence of ints or 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. If Tensor it is expected to have [B] shape.

    Default: None

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

    Default: False

Return type:

Tensor

Returns:

Gaussian Blurred version of the batch of images.