read_image — Torchvision main documentation
pytorch.org › torchvisionread_image. Reads a JPEG or PNG image into a 3 dimensional RGB or grayscale Tensor. Optionally converts the image to the desired format. The values of the output tensor are uint8 in [0, 255]. path ( str) – path of the JPEG or PNG image. mode ( ImageReadMode) – the read mode used for optionally converting the image.