Skip to content
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 or BGR input? #36

Open
acnazarejr opened this issue May 4, 2019 · 4 comments
Open

RGB or BGR input? #36

acnazarejr opened this issue May 4, 2019 · 4 comments

Comments

@acnazarejr
Copy link

acnazarejr commented May 4, 2019

The readme.md has a code example of how to use the code:

img = cv2.imread("ivan.jpg")
detector = MTCNN()
print(detector.detect_faces(img))

In this example, the img is a BGR image (opencv format). But, I think the correct is to convert the image to RGB.

I did some tests, and the model has better results with RGB images.

@Andriy963
Copy link

I tested this solution on Wider Face validation dataset for both cases(RGB and BGR) and got next results:
For BGR images(using code from readme file at this repo):
==================== Results ====================
Easy Val AP: 0.5647998370785989
Medium Val AP: 0.5219529625700366
Hard Val AP: 0.2856212575529135

For RGB images(with converting to RGB after image reading):
==================== Results ====================
Easy Val AP: 0.8069582917049369
Medium Val AP: 0.7637617089872778
Hard Val AP: 0.4867522878479363

So, there should be converting to RGB format before processing.

@nyck33
Copy link

nyck33 commented Aug 18, 2019

@Andriy963 @acnazarejr Great to know, I just posted on StackExchange about this how pyplot.imread() was giving better results than the cv2.imread()

However, now my output when I cv2.imwrite() looks very blue.

@raviam
Copy link
Contributor

raviam commented Sep 13, 2019

@nyck33 For the blue output images, you can change the colormap of the image before cv2.imwrite() by doing image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR) and passing it to cv2.imwrite()

@punitha-valli
Copy link

@acnazarejr @Andriy963 @nyck33 @raviam @akofman

Can you please tell me, which script is suitable to get the boundary box details as ".data" format, for my dataset (OULU),

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants