taotaonice / FaceShifter

Try to reproduce FaceShifter
250 stars 62 forks source link

Line 100 in train_AEI.py #11

Open rookiecm opened 4 years ago

rookiecm commented 4 years ago

Could you please expalin why you crop Xs to Xs[19:237, 19:237] before sending to arcface ? The code lies in Line 100 of train_AEI.py ? embed, Xs_feats = arcface(F.interpolate(Xs[:, :, 19:237, 19:237], [112, 112], mode='bilinear', align_corners=True))

taotaonice commented 4 years ago

Could you please expalin why you crop Xs to Xs[19:237, 19:237] before sending to arcface ? The code lies in Line 100 of train_AEI.py ? embed, Xs_feats = arcface(F.interpolate(Xs[:, :, 19:237, 19:237], [112, 112], mode='bilinear', align_corners=True)) When I perform face alignment on face datasets which method is used in arcface, I found that the aligned faces usually miss chin. So I enlarge the side of all the bounding box by a factor of 1/0.85.

taotaonice commented 4 years ago

So Xs[:, :, 19:237, 19:237] is the aligned face for arcface

rookiecm commented 4 years ago

So Xs[:, :, 19:237, 19:237] is the aligned face for arcface

Great discovery !

lzhbrian commented 4 years ago

Could you please explain how do you find that Xs[:, :, 19:237, 19:237] is the aligned face for arcface? @taotaonice

taotaonice commented 4 years ago

Could you please explain how do you find that Xs[:, :, 19:237, 19:237] is the aligned face for arcface? @taotaonice

...... I enlarge the face alignment bounding box by a factor of 1/0.85 and crop size is (256, 256), so Xs[:, :, 19:237, 19:237] is the aligned face