ImageDataGenerator file formats
See original GitHub issueNot a question but perhaps a suggestion that the file formats that are read, when using the image data augmentation module for example a direct read of file on a local directory with datagen.flow_from_directory()
, are too specific and no useful message error is communicated back to the user if you happen to read files not included in the white_list_formats = {'png', 'jpg', 'jpeg', 'bmp', 'ppm'}
. Is it possible to communicate a useful error message if the file format is not part of the list or perhps expose white_list_formats
to be set outside the script.
Took me me few hours to figure out why the module wouldn’t read my images in .tiff
format. As you can see from the list above. ‘tiff’ is not one of the default file formats. Adding it to the list on line 969
in keras/preprocessing/image.py
resolves the problem.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:12
- Comments:8
It would be good to have the ImageDataGenerator read .npy files as though they were another image format. I am working on noise removal, and it is hard to get a real example that might not be harmed by truncating to 8 bits. I have the images in a float format, but reading an preprocessing them in Python is slow (I imaging the standard ImageDataGenerators can pre-fetch and things like that).
Does this edit work for “.npy” numpy arrays?