Shortcuts

adjust_sharpness

torchvision.transforms.functional.adjust_sharpness(img: torch.Tensor, sharpness_factor: float)torch.Tensor[source]

Adjust the sharpness of an image.

Parameters
  • img (PIL Image or Tensor) – Image to be adjusted. If img is torch Tensor, it is expected to be in […, 1 or 3, H, W] format, where … means it can have an arbitrary number of leading dimensions.

  • sharpness_factor (float) – How much to adjust the sharpness. Can be any non negative number. 0 gives a blurred image, 1 gives the original image while 2 increases the sharpness by a factor of 2.

Returns

Sharpness adjusted image.

Return type

PIL Image or Tensor

Examples using adjust_sharpness:

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