Open vvigilante opened 4 years ago
@vvigilante right before this the RGB image seems to be converted first to BGR via
x_temp = x_temp[..., ::-1]
https://github.com/rcmalli/keras-vggface/blob/master/keras_vggface/utils.py#L44
So x_temp[..., 2]
now correctly refers to the R channel, from which we subtract the larger mean. So this code indeed appears correct. Does this sound about right?
Ok, thank you, then my error is about the channel order: the model is trained with BGR channel order.
Here we see the preprocessing from the official source: https://github.com/keras-team/keras-preprocessing/blob/master/keras_preprocessing/image/utils.py The means are:
(131.0912, 103.8827, 91.4953)
while in this repository we have
It appears to me that both sources (this repository and the official source) use RGB channel order, so they should use the same order for the means.
The official order makes sense, because there is more red (131) than blue (91), and this appears right for face images.
Am I missing something or is this an error? Thank you for your response! Vincenzo