-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RGB inputs or BGR inputs for model.predict(img)? #39
Comments
Hello, the predict method converts the image into RGB. So it's okay, to pass a BGR array. |
Hello, Thanks for your reply. I have already seen that in the code. The problem is the line above (https://github.com/thohemp/6DRepNet/blob/master/sixdrepnet/regressor.py#L66):
that, I think, by default, converts an array with three channels into an RGB PIL image as it does not now which channel is what color. Thus |
You are correct, I just tested it. Swapping channels before using PIL should fix this: img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) Thanks! |
Thanks for checking this and happy that helped fix a bug at the end! |
First, thanks for this great work and for sharing your code.
In the running example,
the image is loaded as a BGR numpy array, as it is the default mode of OpenCV. However, I think the model training has been done using RGB numpy arrays as the images were opened using PIL.Image.Open. Thus, I am wondering if we should convert the BGR arrays into RGB arrays before using them as input for the model.
Would you mind clarifying this?
The text was updated successfully, but these errors were encountered: