Does ImageDataGenerator add more images to my dataset?

后端 未结 6 1400
天命终不由人
天命终不由人 2020-12-08 07:49

I\'m trying to do image classification with the Inception V3 model. Does ImageDataGenerator from Keras create new images which are added onto my dataset? If I h

6条回答
  •  温柔的废话
    2020-12-08 08:39

    Here is my attempt to answer as I also had this question on my mind.

    ImageDataGenerator will NOT add new images to your data set in a sense that it will not make your epochs bigger. Instead, in each epoch it will provide slightly altered images (depending on your configuration). It will always generate new images, no matter how many epochs you have.

    So in each epoch model will train on different images, but not too different. This should prevent overfitting and in some way simulates online learning.

    All these alterations happen in memory, but if you want to see these images you can save them to disc, inspect them, see how many of them were generated and get the sense of how ImageDataGenerator works. To do this pass save_to_dir=/tmp/img-data-gen-outputs to function flow_from_directory. See docs.

提交回复
热议问题