adjust_saturation¶
- torchvision.transforms.functional.adjust_saturation(img: Tensor, saturation_factor: float) Tensor [source]¶
调整图像的颜色饱和度。
- 参数:
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) – 调整饱和度的程度。0 将得到黑白图像,1 将得到原始图像,而 2 将使饱和度增强 2 倍。
- 返回:
饱和度调整后的图像。
- 返回类型:
PIL 图像或张量