I've searched for similar questions but found no solution to what i am trying to do. I have 16-bit grayscale images, and i am trying to fit them in keras ImageDataGenerator. When using functions like: flow_from_dataframe, it yields images all with the same pixel value (incorrect).
I tried using the keras preprocess_input, rescale to [0,1], to [-1,1] with a custom preprocessing function, but none of this worked. I also set the color_mode='grayscale' in ImageDataGenerator.
I further tested converting to 8-bit, and it worked. I triplicated the number of channels, and it was not the issue, since it still worked with 8-bit. I've read that keras in this case uses PIL library to read images, and since it doesn't treat 16-bit correctly, it returns that error. I saw that we could set a different library for loading images, but i don't know how to do that.
Doas anyone know an alternative for using 16-bit images? In the last case, i would try a custom generator, but i would really like to profit from already built and tested functions for this purpose.
I aim to use those images to fine-tune a pre-trained network, so i would like to standardize the type of input i use.
Thanks.