I use the image generator for keras as follows:
val_generator = datagen.flow_from_directory(
path+'/valid',
target_size=(224, 224),
batch_size=batch_size,)
x,y = val_generator.next()
for i in range(0,1):
image = x[i]
plt.imshow(image.transpose(2,1,0))
plt.show()
This shows the wrong colors:

I have two questions.
Edit: this is what my datagen looks like
datagen = ImageDataGenerator(
rotation_range=3,
fill_mode='nearest',
width_shift_range=0.2,
height_shift_range=0.2,
horizontal_flip=True
)
Edit 2:
After Marcin's answer:
image = 255 - image
I get normal colors, but there are still some weird colors:

source
share