DefTruth / lite.ai.toolkit

🛠 A lite C++ toolkit of awesome AI models, support ONNXRuntime, MNN. Contains YOLOv5, YOLOv6, YOLOX, YOLOv8, FaceDet, HeadSeg, HeadPose, Matting etc. Engine: ONNXRuntime, MNN.
https://github.com/DefTruth/lite.ai.toolkit
GNU General Public License v3.0
3.53k stars 672 forks source link

How to obtain KPS from using Retinaface implementation #385

Closed cyrusbehr closed 1 year ago

cyrusbehr commented 1 year ago

First of all, thank you for the great work.

I am working off of the retinaface example, however I also require the facial landmarks (which are not extracted in the implementation for some reason).

I can see that the output at index 2 is the face landmarks, and has shape:

Output: 2 Name: landmarks Dim: 0 :1
Output: 2 Name: landmarks Dim: 1 :31984
Output: 2 Name: landmarks Dim: 2 :10

1) How are the landmarks represented. Is it (x0, x1, x2, x3, x4, y0, y1, y2, y3, y4) or (x0, y0, x1, y1, x2, y2, ...)? 2) Once I have the xy pairs, how do I convert them back to original image reference frame?

cyrusbehr commented 1 year ago

I ended up using this TensorRT implementation and adapting it for onnxruntime (the post processing code is identical).

angelabr commented 5 months ago

Hi @cyrusbehr would it be possible to share that part of the code? Thank you