I have a few million 16 bit tif images that I want to load in with a dataloader and train.
I want to apply the following torchvision transforms:
Compose(Random Rotation, Random Crop, Random Horizontal Flip, Rescale, ToTensor, Normalize)
I would like these transformation to occur while scaling the images which are in the range (0,65535) to be in the range (0,1).  The problem is something funny is happening to the way the images are getting scaled.
To clarify a little bit, the max pixel value of every image image (when doing np.max) is usually around 5000 when I print the values before any transforms.  However, later before going into the ToTensor transform, every image suddenly has a max value of 255.  Then, because ToTensor scales [0,255] images to [0,1], images end up being [0,1].  But I think this is incorrect scaling because images seem very bright, brighter than they should normally be.
How can I make it so that this scaling doesn’t occur (so I can just manually divide by 65535 at the end)?