Table of Contents
Shortcuts

# GaussianBlur

class torchvision.transforms.v2.GaussianBlur(kernel_size: Union[int, Sequence[int]], sigma: Union[int, float, Sequence[float]] = (0.1, 2.0))

  [BETA] Blurs image with randomly chosen Gaussian blur.

  Note

  The GausssianBlur transform is in Beta stage, and while we do not expect disruptive breaking changes, some APIs may slightly change according to user feedback. Please submit any feedback you may have in this issue: https://github.com/pytorch/vision/issues/6753.

  If the input is a Tensor, it is expected to have […, C, H, W] shape, where … means an arbitrary number of leading dimensions.

  Parameters:

    - kernel_size (int or sequence) – Size of the Gaussian kernel.

    - sigma (float or tuple of python:float (min, max)) – Standard deviation to be used for creating kernel to perform blurring. If float, sigma is fixed. If it is tuple of float (min, max), sigma is chosen uniformly at random to lie in the given range.

  static get_params(sigma_min: float, sigma_max: float) → float

    Choose sigma for random gaussian blurring.

    Parameters:

      - sigma_min (float) – Minimum standard deviation that can be chosen for blurring kernel.

      - sigma_max (float) – Maximum standard deviation that can be chosen for blurring kernel.

    Returns:

      Standard deviation to be passed to calculate kernel for gaussian blurring.

    Return type:

      float

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.