Online removal of images from Keras pipeline
I did the same thing but i changed my strategy, i would think it would be helpful for you too; i tried out to make a dataframe for the images and the labels and then remove the rows for the images that don't wanna to flow into model and then instead of flow from directory, i used flow from dataframe
by this way, you could even remove images based on particular labels, size, created time, modified time, and etc.
I am using in Keras the flow_from_directory method to load images from specific categories, where folders in my train path correspond to the different classes. This works all fine.
I am now in the situation that I’d like to remove specific image files during analysis due to annotation errors. At the same time, to maintain the raw data I would not like to resort to removing the images from disk.
On the other hand, creating a new file structure without the removed images would undesirably add disk memory.
I was wondering if Keras offers a way to enter a simple list of image filenames that should be ignored during the training stage, such as [example1.jpg, example9.jpg, example18.jpg]. Is there anywhere during ImageDataGenerator or flow_from_directory a parameter where this can be done ?
Any advice would be welcome !