deepinsight / deepinsight/insightface

Why cv2.COLOR_BGR2RGB should be done in face_align_landmark() function?

Open
#2,379 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

I'd like to do face alignment via calling this function:

https://github.com/deepinsight/insightface/blob/fc622003d5410a64c96024563d7a093b2a55487c/recognition/_evaluation_/ijb/ijb_evals.py#L91

I'm wondering is it necessary to change image channel by `COLOR_BGR2RGB` here?

https://github.com/deepinsight/insightface/blob/fc622003d5410a64c96024563d7a093b2a55487c/recognition/_evaluation_/ijb/ijb_evals.py#L104

Because after calling `face_align_landmark()` I get blue face. Should I do consider this one for getting embedding feature of arcface? Or I could Ignore this one by running another `cv2.cvtColor(ndimage, cv2.COLOR_RGB2BGR)`?

Input image:

![9](https://github.com/deepinsight/insightface/assets/7418329/958bd4dc-01cd-4781-810b-b99bc447a8bb)

detected faces and aligned faces:

![9 jpg_1](https://github.com/deepinsight/insightface/assets/7418329/956d4f65-e6c1-4374-93a1-e3b847822cfa)
![9 jpg_2](https://github.com/deepinsight/insightface/assets/7418329/f4addeec-a3bb-4162-9fef-14b1b5a852f8)
![9 jpg_3](https://github.com/deepinsight/insightface/assets/7418329/04272222-5a01-49f5-9166-1e4e3721bbea)

![9 jpg_0](https://github.com/deepinsight/insightface/assets/7418329/e77b486c-3e64-445a-a6cc-a02dd3cb496d)

![9 jpg_4](https://github.com/deepinsight/insightface/assets/7418329/9143f59a-e772-4b6f-9ca9-7de075906462)
![9 jpg_5](https://github.com/deepinsight/insightface/assets/7418329/3fcf4ab4-3a9d-4bca-aa47-154c1c234564)
![9 jpg_6](https://github.com/deepinsight/insightface/assets/7418329/00354cad-6a45-4cad-9667-5f9c07205432)
![9 jpg_7](https://github.com/deepinsight/insightface/assets/7418329/fbf3cc6e-d901-4076-9911-95b224fd49ca)

Thanks in advance.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.