I am feeding RGB color images to a Neural Network implemented with Keras. How can I have Keras convert the images to a different color space (e.g. YUV, Lab, or some grayscal
If you import tensorflow, you can use the tf.image.rgb_to_hsv() function in the lambda:
def hsv_conversion(x): import tensorflow as tf return tf.image.rgb_to_hsv(x) model.add(Lambda(hsv_conversion, input_shape=(160, 320, 3)))