Загрузка
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.
img (PIL Image or Tensor) – Image to be blurred
kernel_size (sequence of python:ints or int) –
Gaussian kernel size. Can be a sequence of integers
like (kx, ky) or a single integer for square kernels.
sigma (sequence of python:floats or float, 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.
Gaussian Blurred version of the image.
PIL Image or Tensor
Examples using gaussian_blur: