SthPhoenix / InsightFace-REST

InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Apache License 2.0
498 stars 116 forks source link

Support for coordinate and synthetic mask models (landmark_2d_106 , landmark_3d_68) #125

Open eous opened 9 months ago

eous commented 9 months ago

landmark_2d_106: https://github.com/deepinsight/insightface/blob/master/alignment/coordinate_reg/image_infer.py#L9

landmark_3d_68: https://github.com/deepinsight/insightface/blob/master/python-package/insightface/app/mask_renderer.py#L94

SthPhoenix commented 6 months ago

Hi! Main goal of this repo is face recognition. Those models make no improvements in terms of recognition - recognition module uses 5 key points for recognition, so 106 and 68 keypoints models are excessive.
Also those models requires loose crops of faces for landmark detection, and uses non standard WxH input size, so those models could be added to pipeline, but at cost of huge performance loses. Currently pipeline looks like this: detect -> crop 112x112 -> embed -> return [kps, embeddings, crops]

With models above it would look like this:

detect -> crop 112x112 -> embed ----------------->--> return [kps, 106\68kps, embeddings, crops]
        \-> crop 256x256 -> detect 106\68 kps---/
eous commented 6 months ago

Understood, I was looking to do something along the lines of friendly face detection which requires more points but it sounds like this project isn’t a great fit. Thank you for your response.

SthPhoenix commented 6 months ago

Yes, as I said before, it can be done, but will break performance. Though I'll keep in mind that this feature might be useful.