标签:相同 dir port generator 图像 ref ssi pre director
from keras.preprocessing import image
in_path = ‘./dataset‘
out_path = ‘output‘
datagen = image.ImageDataGenerator()
#指定target_size后所有图像都变为相同大小
gen_data = datagen.flow_from_directory(in_path, batch_size=1, shuffle=False,
save_to_dir=out_path+‘resize‘,
save_prefix=‘gen‘, target_size=(224, 224))
for i in range(20):
gen_data.next()
标签:相同 dir port generator 图像 ref ssi pre director
原文地址:https://blog.51cto.com/5669384/2421081