【发布时间】:2022-08-21 19:07:21
【问题描述】:
我有一个代码来增强如下图像,
# Augmentation
train_datagen = ImageDataGenerator(rotation_range=5, # rotation
width_shift_range=0.2, # horizontal shift
zoom_range=0.2, # zoom
horizontal_flip=True, # horizontal flip
brightness_range=[0.2,0.8]) # brightness
# Epochs
epochs = 25
# Batch size
batch_size = 32
history = model.fit(train_datagen.flow(x_train,y_train,
batch_size=batch_size,
seed=27,
shuffle=False),
epochs=epochs,
steps_per_epoch=x_train.shape[0] // batch_size,
validation_data=(x_test,y_test),
verbose=1)
我试图准确了解在训练过程中由于增强而将创建多少额外的图像。 第二个问题是如何为训练动态创建额外的 50K 图像?
-
嗨@Neg,不会创建额外的图像。所有原始图像只是在每个 epoch 中根据提供给
ImageDataGenerator的指令进行转换,然后用于训练,因此每个 epoch 中的图像数量等于您拥有的原始图像数量。
标签: image tensorflow keras image-augmentation