leondgarse / Keras_insightface

Insightface Keras implementation
MIT License
230 stars 56 forks source link

Hard coded values in video_test.py #89

Closed shounakshastri closed 2 years ago

shounakshastri commented 2 years ago

Hello,

I was going through the code and I couldn't make it out what these values are in the video_test.py file.

def face_align_landmarks_sk(img, landmarks, image_size=(112, 112), method="similar"):
    tform = transform.AffineTransform() if method == "affine" else transform.SimilarityTransform()
    src = np.array([[38.2946, 51.6963], [73.5318, 51.5014], [56.0252, 71.7366], [41.5493, 92.3655], [70.729904, 92.2041]], dtype=np.float32)

and

nimgs = (np.array(nimgs) - 127.5) * 0.0078125

How are these numbers derived? Thank you.

leondgarse commented 2 years ago
shounakshastri commented 2 years ago

Ah ok! Thank you!