decode_webp¶
- torchvision.io.decode_webp(input: Tensor, mode: ImageReadMode = ImageReadMode.UNCHANGED) Tensor [source]¶
解码 WEBP 图像为 3 维 RGB[A] Tensor。
输出 Tensor 的值是 0 到 255 之间的 uint8。
- 参数:
input (Tensor[1]) – 包含 WEBP 图像原始字节的**一维连续 uint8 张量**。
mode (str 或 ImageReadMode) – 要转换到的图像模式,例如“RGB”。默认为“UNCHANGED”。有关可用模式,请参见
ImageReadMode
。
- 返回:
解码后的图像(Tensor[图像通道, 图像高度, 图像宽度])