Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mentioning the padding policy in transforms.GaussianBlur docs #8246

Merged
merged 9 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion torchvision/transforms/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ def erase(img: Tensor, i: int, j: int, h: int, w: int, v: Tensor, inplace: bool


def gaussian_blur(img: Tensor, kernel_size: List[int], sigma: Optional[List[float]] = None) -> Tensor:
"""Performs Gaussian blurring on the image by given kernel.
"""Performs Gaussian blurring on the image by given kernel, using reflection padding corresponding to the kernel size, to maintain the input shape.
talcs marked this conversation as resolved.
Show resolved Hide resolved
If the image is torch Tensor, it is expected
to have [..., H, W] shape, where ... means at most one leading dimension.

Expand Down
2 changes: 1 addition & 1 deletion torchvision/transforms/v2/_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _transform(self, inpt: Any, params: Dict[str, Any]) -> Any:


class GaussianBlur(Transform):
"""Blurs image with randomly chosen Gaussian blur.
"""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.
talcs marked this conversation as resolved.
Show resolved Hide resolved

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