0

I want to calculate the amount of generated images from the image augmentation API from Keras. It is unclear to me if each setting is also used in combination with other settings.

I have the following settings:

Rotation range: 0.2, Width shift: 0.05, Height shift: 0.05, Shear range: 0.05, Zoom range: 0.05, Horizontal flip: True, Fill mode: Nearest

For example, does it do horizontal flips for all augmentated images as well or only for the input images? And what would then be the total amount of generated images with the parameters above?

Eeuwigestudent1
  • 161
  • 1
  • 2
  • 13

1 Answers1

1
  1. Images are not 'generated' in Keras, see documentation. They are randomly transformed.
  2. Yes, each setting is used in combination with other settings. Each of those have a chance of occurring, the more transformations, the higher the chance your data will be transformed in one or multiple ways.

So, to conclude, total amount of images is the same as the size of your data. If you wish to have more images while some of them should be transformed, you can use two separate copies of each image (though I would advise against it).

You can use apply_transform method of ImageDataGenerator class as well, for each image in your dataset. With this approach you are sure which images are transformed and which are unaltered, I would stick with this idea.

Szymon Maszke
  • 22,747
  • 4
  • 43
  • 83