Shortcuts

decode_webp

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

Decode a WEBP image into a 3 dimensional RGB[A] Tensor.

The values of the output tensor are uint8 between 0 and 255.

Parameters:
  • input (Tensor[1]) – a one dimensional contiguous uint8 tensor containing the raw bytes of the WEBP image.

  • mode (str or ImageReadMode) – The read mode used for optionally converting the image color space. Default: ImageReadMode.UNCHANGED. Other supported values are ImageReadMode.RGB and ImageReadMode.RGB_ALPHA.

Returns:

Decoded image (Tensor[image_channels, image_height, image_width])

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources