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 (str 或 ImageReadMode) – 要將影像轉換為的模式,例如 “RGB”。預設為 “UNCHANGED”。有關可用模式,請參閱
ImageReadMode。
- 返回:
解碼後的影像 (Tensor[影像通道數, 影像高度, 影像寬度])