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