From db95ec61ceb4def950476054416c0b641fe0d971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20B=C3=BCchner?= Date: Thu, 16 Mar 2023 15:07:11 +0100 Subject: [PATCH] Fix precision loss of lms.z variable --- src/face_projection/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/face_projection/core.py b/src/face_projection/core.py index 3a8a03b..5d6b1c7 100644 --- a/src/face_projection/core.py +++ b/src/face_projection/core.py @@ -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,