Keras 图片预处理
作者:互联网
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()
标签:Keras,image,gen,datagen,path,图片,out,预处理,size 来源: https://blog.51cto.com/5669384/2421081