adjust_saturation¶
- torchvision.transforms.functional.adjust_saturation(img: Tensor, saturation_factor: float) Tensor [原始碼]¶
調整圖像的色彩飽和度。
- 參數:
img (PIL Image 或 Tensor) – 要調整的圖像。 如果 img 是 torch Tensor,則預期為 […, 1 或 3, H, W] 格式,其中 … 表示它可以具有任意數量的 leading dimensions。
saturation_factor (float) – 調整飽和度的程度。 0 將給出黑白圖像,1 將給出原始圖像,而 2 將使飽和度增強 2 倍。
- 回傳:
飽和度調整後的圖像。
- 回傳類型:
PIL Image 或 Tensor