Keras model using YCbCr input converted to ARGB model

Hi everyone,

as written in the title, I have trained a model with Keras that takes as Input an YCbCr image.

However, when I convert the model with CoreMLTools, my newly converted model takes an ARGB image as an input.

I saw that it is possible to change colorspace into BGR or even Greyscale, but I could not find any information regarding YCbCr.

My question is simple, is there a way to handle it ? What should be done to make a CoreML model use YCbCr image.

Kind Regards
Answered by kerfuffle in 655610022
Core ML models can only accept RGB or BGR images as inputs (the alpha channel is ignored). If your model wants a YCbCr image, you'll need to put the image into an MLMultiArray instead. You'll also need to change the input of the Core ML model to be a multi-array, not an image.

Alternatively, you could add some layers at the start of the model that convert RGB back to YCbCr, but that seems like more trouble than it's worth.
Accepted Answer
Core ML models can only accept RGB or BGR images as inputs (the alpha channel is ignored). If your model wants a YCbCr image, you'll need to put the image into an MLMultiArray instead. You'll also need to change the input of the Core ML model to be a multi-array, not an image.

Alternatively, you could add some layers at the start of the model that convert RGB back to YCbCr, but that seems like more trouble than it's worth.
Keras model using YCbCr input converted to ARGB model
 
 
Q