快捷方式

decode_webp

torchvision.io.decode_webp(input: Tensor, mode: ImageReadMode = ImageReadMode.UNCHANGED) Tensor[原始碼]

將 WEBP 影像解碼為 3 維 RGB[A] Tensor。

輸出 Tensor 的值是 uint8 型別,範圍在 0 到 255 之間。

引數:
  • input (Tensor[1]) – 一個包含 WEBP 影像原始位元組的一維連續 uint8 Tensor。

  • mode (strImageReadMode) – 要將影像轉換為的模式,例如 “RGB”。預設為 “UNCHANGED”。有關可用模式,請參閱 ImageReadMode

返回:

解碼後的影像 (Tensor[影像通道數, 影像高度, 影像寬度])

文件

訪問 PyTorch 的完整開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源