gaussian_blur — Torchvision 0.22 documentation (original) (raw)

torchvision.transforms.functional.gaussian_blur(img: Tensor, kernel_size: List[int], sigma: Optional[List[float]] = None) → Tensor[source]

Performs Gaussian blurring on the image by given kernel

The convolution will be using reflection padding corresponding to the kernel size, to maintain the input shape. If the image is torch Tensor, it is expected to have […, H, W] shape, where … means at most one leading dimension.

Parameters:

Returns:

Gaussian Blurred version of the image.

Return type:

PIL Image or Tensor

Examples using gaussian_blur: