adjust_saturation¶
- torchvision.transforms.functional.adjust_saturation(img: Tensor, saturation_factor: float) Tensor[source]¶
調整影像的色彩飽和度。
- 引數:
img (PIL Image 或 Tensor) – 要調整的影像。如果 img 是 torch Tensor,則應採用 […, 1 或 3, H, W] 格式,其中 … 表示它可以有任意數量的前導維度。
saturation_factor (float) – 調整飽和度的程度。0 將得到黑白影像,1 將得到原始影像,而 2 將把飽和度增強兩倍。
- 返回:
飽和度調整後的影像。
- 返回型別:
PIL Image 或 Tensor