You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current torchvision.io.read_image function reads a JPEG or PNG image into a 3 dimensional RGB Tensor. When the image has a single channel, this function throws a runtime error saying "RuntimeError: Non-RGB images are not supported.".
It would be nice to add support for non-RGB images.
Motivation
This can be extremely helpful for example when reading in the segmentation maps in the VOC dataset which are originally single-channel png images.
Pitch
This can probably be resolved in the method decode_image by converting the image to RGB with a boolean flag to_rgb=True similar to MXNet's image read method here as an argument.
Alternatives
For now to get around these, one needs to use the PIL Image module or OpenCV. torchvision native io doesn't support these.
The text was updated successfully, but these errors were encountered:
🚀 Feature
The current
torchvision.io.read_image
function reads aJPEG
orPNG
image into a 3 dimensional RGB Tensor. When the image has a single channel, this function throws a runtime error saying "RuntimeError: Non-RGB images are not supported.".It would be nice to add support for non-RGB images.
Motivation
This can be extremely helpful for example when reading in the segmentation maps in the VOC dataset which are originally single-channel png images.
Pitch
This can probably be resolved in the method
decode_image
by converting the image to RGB with a boolean flagto_rgb=True
similar to MXNet's image read method here as an argument.Alternatives
For now to get around these, one needs to use the PIL Image module or OpenCV. torchvision native io doesn't support these.
The text was updated successfully, but these errors were encountered: