0

I am using Keras ImageDataGenerator for data augmentation. After generating ImDatagenerator as follows,

datagen = ImageDataGenerator( rescale=1./255.)     
DG = datagen.flow_from_directory(
        directory='Path_To_Dataset',
        target_size=(img_rows, img_cols), color_mode='rgb',
        classes=['c1', 'c2'], 
        class_mode='categorical',
        batch_size=32, shuffle=True, seed=42,
        subset=None, interpolation='bicubic'
        )

I am trying to change one image's pixels of DG by simply assigning a numpy.ndarray with the same size as follows

DG[0][0][0,:,:,:] = np.random.rand(img_rows,img_cols,3) 

While it does not give any error, but I do not observe any change in the DG.

Hadi Zand
  • 1
  • 1
  • Do you want to do this change to all the images in the batch, or is it just for a one image in the batch? – akilat90 Nov 25 '19 at 09:07
  • I want to apply some changes to all images, for example, suppose I wanna apply multiple filters over all images (not necessarily all images within a patch receive same change) – Hadi Zand Nov 25 '19 at 22:44

0 Answers0