Skip to content

Commit

Permalink
Fix precision loss of lms.z variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Timozen committed Mar 16, 2023
1 parent b6432ba commit db95ec6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/face_projection/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def get_landmarks(self, face_img: np.ndarray):
if results.multi_face_landmarks:
lms = results.multi_face_landmarks[0].landmark
for i in range(468):
self.__landmarks[i, :] = int(lms[i].x * w), int(lms[i].y * h), lms[i].z
# scale z by w to net be removed by conversion to int
self.__landmarks[i, :] = int(lms[i].x * w), int(lms[i].y * h), int(lms[i].z * w)

def apply(
self,
Expand Down

0 comments on commit db95ec6

Please sign in to comment.