how to save resized images using ImageDataGenerator and flow_from_directory in keras

前端 未结 4 1916
情深已故
情深已故 2021-02-14 06:47

I am resizing my RGB images stored in a folder(two classes) using following code:

from keras.preprocessing.image import ImageDataGenerator
dataset=ImageDataGener         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-14 07:17

    Its only a declaration, you must use that generator, for example, .next()

    from keras.preprocessing.image import ImageDataGenerator
    dataset=ImageDataGenerator()
    image = dataset.flow_from_directory('/home/1',target_size=(50,50),save_to_dir='/home/resized',class_mode='binary',save_prefix='N',save_format='jpeg',batch_size=10)
    image.next()
    

    then you will see images in /home/resized

提交回复
热议问题