快捷方式

adjust_contrast

torchvision.transforms.functional.adjust_contrast(img: Tensor, contrast_factor: float) Tensor[原始碼]

調整影像的對比度。

引數:
  • 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.

  • contrast_factor (float) – 對比度調整的程度。可以是任何非負數。0 會得到一個實心的灰色影像,1 會得到原始影像,而 2 會將對比度提高一倍。

返回:

對比度調整後的影像。

返回型別:

PIL 影像或張量

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

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

檢視教程

資源

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

檢視資源