我想在馈入网络之前对我的数据集应用数据扩充。首先,我想在一个样本上尝试Keras ImageDataGenerator类以查看结果。当我以featurewise_center = True,featurewise_std_normalization = True提供参数时,没有问题,但是当我提供rotation_range = 5时,绘图上只有一些黄点。我想知道为什么。这是我的代码和结果:
from keras.preprocessing.image import ImageDataGenerator
from matplotlib import pyplot
# Data augmentation
datagen = ImageDataGenerator(featurewise_center=True, featurewise_std_normalization=True)
datagen.fit(imgs)
gen = datagen.flow(imgs[:1], train_y[:1], 1)
img = next(gen)[0][0]
pyplot.imshow(img)
from keras.preprocessing.image import ImageDataGenerator
from matplotlib import pyplot
# Data augmentation
datagen = ImageDataGenerator(rotation_range=5)
datagen.fit(imgs)
gen = datagen.flow(imgs[:1], train_y[:1], 1)
img = next(gen)[0][0]
pyplot.imshow(img)