adjust_saturation¶
- torchvision.transforms.functional.adjust_saturation(img: Tensor, saturation_factor: float) Tensor [source]¶
Adjust color saturation 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.
saturation_factor (float) – How much to adjust the saturation. 0 will give a black and white image, 1 will give the original image while 2 will enhance the saturation by a factor of 2.
- 返回:
Saturation adjusted image.
- 返回类型:
PIL 图像或张量