Datatypes in Pytorch

How can I use unit16 images in pytorch? If I convert to unit8, I lose a lot of information in my images.


The problem in accessing uint16 images is not a pytorch issue exactly, PIL imaging library doesnot have proper support for uint16 images. You can use OpenCV instead to read and view your images :smile: .

My images are Satellite images, so won’t open with openCV. However, I have converted them to float before transforms.

If they are in forms of array you can use numpy functions to use and manipulate them. Either way of you could upload some example of the Uint16 files somewhere and attatch the link it would be helpful

I have added some data in numpy array here.

I have one more question. How can I convert N dimension image to PIL?
(My problem set has 14 classes and I have to generate binary mask for each.)