gehaocool / CombinedMargin-caffe

caffe implementation of insightface's combined margin method
92 stars 28 forks source link

about lfw-test #13

Closed zys1994 closed 5 years ago

zys1994 commented 5 years ago

after changing face alignment method which i have questioned you, i have got improved from 98.86% to 99.07%. i wonder whether you do pca(n=256) or not? if convenient, can you share your lfw-test.py to me? my email is 1158007644@qq.com, Your help may help me out of confusion, Thanks a lot.

gehaocool commented 5 years ago

I recheck the issue you opened before. The average face landmarks you gave is

{ 30.2946, 65.5318, 48.0252, 33.5493, 62.7299, 52.6963, 52, 72.7366, 92.3655, 92.2041 }

which is different from sphereface and insightface

[ [30.2946, 51.6963], [65.5318, 51.5014], [48.0252, 71.7366], [33.5493, 92.3655], [62.7299, 92.2041] ]

The landmarks I use in both training and test is the same as sphereface and insightface, and if you do the test using different landmarks, that must lead to different performance. The script I use to test on LFW is the same as sphereface, and the lfw dataset is preprocessed using this And by 'pca', do you mean 'Principal component analysis'? I didn't use that anyhow.

zys1994 commented 5 years ago

Thanks for your idea. i I commented out the 'Principal component analysis' but the result is still 99.07%. i use align code is:

def Align_sphereface(input_image, points, output_size = (96, 112)):
    image = copy.deepcopy(input_image)
    src = np.matrix([[points[0], points[2], points[4], points[6], points[8]],
                      [points[1], points[3], points[5], points[7], points[9]], [1, 1, 1, 1, 1]])
    dst = np.matrix([ [30.2946, 65.5318, 48.0252, 33.5493, 62.7299],
                      [51.6963, 51.5014, 71.7366, 92.3655, 92.2041] ])
    T = (src * src.T).I * src * dst.T
    img_affine = cv2.warpAffine(image, T.T, output_size)
    return img_affine

Is different from you? If there is different, I will make change according to insightface.

zys1994 commented 5 years ago

i have find the difference. when i have the new result, i will give you feedback. Thanks a lot