using keras ImageDataGenerator, we can save augmented images as png or jpg :
for X_batch, y_batch in datagen.flow(train_data, train_labels, batch_size=batch_size,\
save_to_dir='images', save_prefix='aug', save_format='png'):
I have a dataset of the shape (1600, 4, 100,100), which means 1600 images with 4 channels of 100x100 pixels. How can I save the augmented data as numpy array of shape (N,4,100,100) instead of individual images?
flow(x, y): Takes numpy data & label arrays, and generates batches of augmented/normalized data. Yields batches **indefinitely, in an infinite loop**.. Although, you could probably exact only the first M batches and join them together.