GaussianBlur — Torchvision main documentation (2024)

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

Blurs image with randomly chosen Gaussian blur kernel.

The convolution will be using reflection padding corresponding to the kernel size, to maintain the input shape.

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

Parameters:

Examples using GaussianBlur:

static get_params(sigma_min: float, sigma_max: float) float[source]

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

GaussianBlur — Torchvision main documentation (2024)
Top Articles
Latest Posts
Article information

Author: Gregorio Kreiger

Last Updated:

Views: 5721

Rating: 4.7 / 5 (77 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Gregorio Kreiger

Birthday: 1994-12-18

Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

Phone: +9014805370218

Job: Customer Designer

Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.