I have a question about how to use the ImageDataGenerator for my regression problem. I have ~5000 images and each image has a corresponding 3-dimensional target that I want to regress. From what I understand, the ImageDataGenerator function allows us to read data into CPU memory while some other data is being processed (gradient computation in GPU). This becomes important for me as I can't load all images into memory directly. The problem though is that I need access to image filenames that are being returned by the generator. I had a look at the code in
https://github.com/fchollet/keras/blob/master/keras/preprocessing/image.py. I need the index_array or self.filenames[index_array] in class DirectoryIterator as I can get the targets from these filenames. What is the best way to do this ? Is there a way to make this part of the function's return arguements ?