decode_heic
- torchvision.io.decode_heic(input: Tensor, mode: ImageReadMode = ImageReadMode.UNCHANGED) → Tensor[source]
[DEPRECATED] Use TorchCodec instead.
Decode an HEIC image into a 3 dimensional RGB[A] Tensor.
[DEPRECATED] Use TorchCodec instead.
Decode an HEIC image into a 3 dimensional RGB[A] Tensor.
The values of the output tensor are in uint8 in [0, 255] for most images. If
the image has a bit-depth of more than 8, then the output tensor is uint16
in [0, 65535]. Since uint16 support is limited in pytorch, we recommend
calling torchvision.transforms.v2.functional.to_dtype() with
scale=True after this function to convert the decoded image into a uint8
or float tensor.
input (Tensor[1]) – a one dimensional contiguous uint8 tensor containing the raw bytes of the HEIC image.
mode (str or ImageReadMode) – The mode to convert the image to, e.g. “RGB”.
Default is “UNCHANGED”. See ImageReadMode
for available modes.
Decoded image (Tensor[image_channels, image_height, image_width])