How to convert images color space in Keras?

前端 未结 2 574

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

2条回答
  •  感动是毒
    2020-12-20 21:36

    I was looking to use opencv in an preprocessing layer using Keras lambda layers to ensure that all the preprocessing done on my images are the same whether training, testing or predicting. However I found that you must use tensor operations on tensors. So you're limited to simple arithmetic operations in your lambda and whatever tensor-operations you can find in keras.backend.

提交回复
热议问题