insightface icon indicating copy to clipboard operation
insightface copied to clipboard

Reference Points used for Arcface Alignment

Open commanderka opened this issue 4 years ago • 7 comments

Hi,

why do you use the following points for image alignment when doing preprocessing for training with arcface loss?

arcface_src = np.array([ [38.2946, 51.6963], [73.5318, 51.5014], [56.0252, 71.7366], [41.5493, 92.3655], [70.7299, 92.2041] ], dtype=np.float32 )

It seems that first of all eyes and mouth points do not have the same y coordinates. Furthermore when doing mirroring along the y axis (which is a common data augmentation operation) the position of the landmarks changes slightly which could have a bad influence on training?

So where do these coordinates come from and why are they not designed such that the mirroring transformation does not change the landmark locations?

Kind regards,

Christian

commanderka avatar Jun 10 '20 15:06 commanderka

It's coming from another paper(git repo). Slight y-axis changes while doing left-right mirroring can bring some image-augmentation.

nttstar avatar Jun 18 '20 02:06 nttstar

@nttstar Hi,

Could you provide a reference to that git repo? Also, if I have an input image which is not 112? Do I need to multiply arcface_src by the scaling factor?

AugustasMacys avatar Nov 10 '20 15:11 AugustasMacys

@AugustasMacys What we only need is the 5 landmarks from your input image, it's not about the original image size.

nttstar avatar Nov 10 '20 23:11 nttstar

@nttstar so if my image is 224*224 for example then arcface_src should stay arcface_src = np.array([ [38.2946, 51.6963], [73.5318, 51.5014], [56.0252, 71.7366], [41.5493, 92.3655], [70.7299, 92.2041] ], dtype=np.float32 ) ? Sorry for inconvenience, but just want to clarify.

AugustasMacys avatar Nov 10 '20 23:11 AugustasMacys

When the output image shall have size 224*224 the points used for alignment should be 2* np.array([ [38.2946, 51.6963], [73.5318, 51.5014], [56.0252, 71.7366], [41.5493, 92.3655], [70.7299, 92.2041] ], dtype=np.float32 ) Would be interesting to see how the choice of these alignment landmarks influences recognition performance, but I guess you need lots of computational resources to evaluate.

commanderka avatar Nov 11 '20 00:11 commanderka

You can share The Paper about numbers in arcface_src which you talked above

NguyenThaiHoc1 avatar Nov 23 '20 04:11 NguyenThaiHoc1

Have you find the git repo or paper about the reference points? Thx!

wawaa avatar May 10 '23 02:05 wawaa