Does ImageDataGenerator add more images to my dataset?

后端 未结 6 1422
天命终不由人
天命终不由人 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:54

    It all depends on how many epochs you run, as @today answered, fitting the model with the generator will make the generator provide as many images as needed, depending on steps_per_epoch.

    To make things easier to understand, put i.e. 20 images into two whatever folders (mimicking classified data), create a generator out of the parent folder and run a simple for loop

    count = 0
    for image, label in my_test_generator:
        count += 1
        print(count)
    

    The first thing you should confirm that you see the message Found 20 images belonging to 2 classes., and the loop itself will NOT stop after 20 iterations, but it will just keep incrementing and printing endlessly (I got mine to 10k and stopped it manually). The generator will provide as many images as are requested, whether they were augmented or not.

提交回复
热议问题