Closed saurabheights closed 3 years ago
Here index 0 is mapped to 2 and 2 mapped to 0 - https://github.com/jiwoon-ahn/psa/blob/master/network/vgg16d.py#L15
Image is initially loaded in RGB Mode - https://github.com/jiwoon-ahn/psa/blob/9493e59bef16687ecb4821387e38e6460857f508/voc12/data.py#L69
Finally, the transform is simply applied to RGB image, no where there is need for channel swapping. https://github.com/jiwoon-ahn/psa/blob/master/train_cls.py#L82
P.S. It could be a bug due to some legacy code using OpenCV to open image, which defaults to BGR mode.
That's part of preprocessing for VGG pretrained model, found it - https://www.tensorflow.org/api_docs/python/tf/keras/applications/vgg16/preprocess_input
Here index 0 is mapped to 2 and 2 mapped to 0 - https://github.com/jiwoon-ahn/psa/blob/master/network/vgg16d.py#L15
Image is initially loaded in RGB Mode - https://github.com/jiwoon-ahn/psa/blob/9493e59bef16687ecb4821387e38e6460857f508/voc12/data.py#L69
Finally, the transform is simply applied to RGB image, no where there is need for channel swapping. https://github.com/jiwoon-ahn/psa/blob/master/train_cls.py#L82
P.S. It could be a bug due to some legacy code using OpenCV to open image, which defaults to BGR mode.