1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.94k stars 1.33k forks source link

There are many faces in an image, how do I figure out the corresponding relations between lists of landmarks and faces??? #198

Closed CXiaoDing closed 3 years ago

CXiaoDing commented 3 years ago

There are many faces in an image, how do I figure out the corresponding relations between lists of landmarks and faces??? Thank you.@1adrianb @ashafaei @jeongyoonlee @xerus @siarez

1adrianb commented 3 years ago

The faces are retrieved in random order (the one provided by the face detector). You could I suppose assign them based on overlap with the target bounding boxes, but this will not be guaranteed to work always. If your goal is to track the faces between frames I am afraid the order of the returned faces wont be the same.

CXiaoDing commented 3 years ago

So if I get five 68-points landmarks in a five-faces image, I can't figure out which landmark belong to which face?

1adrianb commented 3 years ago

You can make the assignments as suggested above, using the ground truth bounding boxes and the landmarks. Of course, there is also the option of doing this manually, visually inspecting the plotted points.

If you already have the bounding boxes, you can simply pass them explicitly (bypassing the face detector). In this case the keypoints will be returned in the same order with that of the sent bounding boxes (i.e. the first set of 68 points from the list will correspond to the first bounding box and so one).

What I was trying to say is that there is no particular order in which they are returned since the face detector has no particular preferences.