question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImageDataGenerator file formats

See original GitHub issue

Not 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:closed
  • Created 6 years ago
  • Reactions:12
  • Comments:8

github_iconTop GitHub Comments

3reactions
RichardKirkcommented, Apr 15, 2021

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).

0reactions
bkonkcommented, Nov 15, 2019

Does this edit work for “.npy” numpy arrays?

Read more comments on GitHub >

github_iconTop Results From Across the Web

tf.keras.preprocessing.image.ImageDataGenerator - TensorFlow
Generate batches of tensor image data with real-time data augmentation.
Read more >
Image data preprocessing - Keras
Supported image formats: jpeg, png, bmp, gif. Animated gifs are truncated to the first frame. Arguments. directory: Directory where the data is located....
Read more >
Keras ImageDataGenerator methods: An easy guide
To derive meaningful information for the above images, two (or generally more) text files are provided with dataset namely classes.txt and bboxes.txt (Dropbox ......
Read more >
Using ImageDataGenerator with images in .npy format
I wanted to use flow_from_directory() so I stored the images as recommended in the documentation (one folder per class). The problem is this ......
Read more >
Tutorial on Keras ImageDataGenerator with ... - Vijayabhaskar J
Now you can utilize Keras's ImageDataGenerator to perform image augmentation by directly reading the CSV files through pandas dataframe.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found