I’m training Neural Network with ImageNet dataset and I noticed that images are in BGR color format when I read them using OpenCV function
cv2.imread(), so does is affect training accuracy?, if yes then how can I change it to RGB in pytorch?
It will not affect your NN’s accuracy, in general. However, if you are using a pre-trained CNN, then it likely expects RGB images as input, and will not do as well on BGR images initially and will have to re-learn its weights for BGR.
You can convert BGR to RGB using
You can also consider the following alternatives for reading images:
Answered By – adeelh
Answer Checked By – Jay B. (AngularFixing Admin)