Closed shounakshastri closed 2 years ago
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)
are points where typical face left_eye, right_eye, nose, mouse_left, mouse_right
located in a 112 x 112
image. Detected face key points are aligned to these points.
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)
aa = np.ones([112, 112, 3])
plt.imshow(aa)
plt.scatter(src[:, 0], src[:, 1])
nimgs = (np.array(nimgs) - 127.5) * 0.0078125
is rescaling image in [0, 255]
to [-1, 1]
, where 0.0078125 == 1 / 128
. Several ways can be applied for this aim:
img = (img - 128) / 128
# Or
img = img / 128 - 1
Not a big difference.
Ah ok! Thank you!
Hello,
I was going through the code and I couldn't make it out what these values are in the
video_test.py
file.and
nimgs = (np.array(nimgs) - 127.5) * 0.0078125
How are these numbers derived? Thank you.