快捷方式

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 影像或張量

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

為初學者和高階開發者提供深入的教程

檢視教程

資源

查詢開發資源並讓您的問題得到解答

檢視資源