deepinsight / insightface

State-of-the-art 2D and 3D Face Analysis Project
https://insightface.ai
22.88k stars 5.35k forks source link

problem about the preprocess of face image before feed it into face recognition onnx model #2076

Open smilealvin92 opened 2 years ago

smilealvin92 commented 2 years ago

I download the resnet 18 pretrained model(R18 | Glint360K | 72.07) for face encoding or face embedding or anything we call it, and it is onnx format. I do not know how to preprocess the aligned face image before feed it into this onnx model. I use the another face detect model and the alignment of dlib library. in the face embedding, I'd like use insightface pretrained model. I'd appeciated if any one can help me.

nttstar commented 2 years ago

https://github.com/deepinsight/insightface/blob/master/python-package/insightface/utils/face_align.py#L70

smilealvin92 commented 2 years ago

https://github.com/deepinsight/insightface/blob/master/python-package/insightface/utils/face_align.py#L70

Many thanks! You are a good man.

smilealvin92 commented 2 years ago

https://github.com/deepinsight/insightface/blob/master/python-package/insightface/utils/face_align.py#L70

I found that if we had the landmarks, we do not need the location of the face. Only the origin image and landmarks is enough to do the face alignment. And I found that the 5 point landmarks used in the DLIB is different with other library and models. In dlib, doing face alignment need the face location, face landmarks and the origin image. This problem bother me a couple of days.