快捷方式

adjust_contrast

torchvision.transforms.functional.adjust_contrast(img: Tensor, contrast_factor: float) Tensor[source]

Adjust contrast of an image.

参数:
  • 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.

  • contrast_factor (float) – How much to adjust the contrast. Can be any non-negative number. 0 gives a solid gray image, 1 gives the original image while 2 increases the contrast by a factor of 2.

返回:

Contrast adjusted image.

返回类型:

PIL 图像或张量

文档

访问全面的 PyTorch 开发者文档

查看文档

教程

为初学者和高级开发者提供深入的教程

查看教程

资源

查找开发资源并让您的问题得到解答

查看资源