How do I save my augmented images with their class label in the filename? Or, is there a way it knows which class the new image belongs to?
EDIT:
datagen = ImageDataGenerator(horizontal_flip=True, vertical_flip=True)
i = 0
for batch in datagen.flow_from_directory('data/train', target_size=
(100,100),
shuffle=False, batch_size=batch_size, save_to_dir='data/train/'):
i += 1
if i > 20: # save 20 images
break # otherwise the generator would loop indefinitely
print("Saved flipped images")
I have three class subdirectories inside of data/train. After running this, I can't tell which images have been augmented, although I do see that about a third of the total # of images have been saved. Is there something missing in my code to specify that the images be named by class, and that each class be looped through to create new images?
EDIT #2: Folder structure: data/train 3 classes in separate folders: n02088364, n02096585, n02108089 The newly created images are saved to data/train, not to individual class folders.