From 17cb629fa5e856a2f5bc18246c60259076cb5fc1 Mon Sep 17 00:00:00 2001 From: SachaDee Date: Fri, 28 Jun 2024 19:42:09 -0300 Subject: [PATCH 1/2] Update face_landmark_estimator.py np.float to float --- ptgaze/head_pose_estimation/face_landmark_estimator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ptgaze/head_pose_estimation/face_landmark_estimator.py b/ptgaze/head_pose_estimation/face_landmark_estimator.py index 1653f6c..770ea75 100644 --- a/ptgaze/head_pose_estimation/face_landmark_estimator.py +++ b/ptgaze/head_pose_estimation/face_landmark_estimator.py @@ -57,10 +57,10 @@ def _detect_faces_dlib(self, image: np.ndarray) -> List[Face]: for bbox in bboxes: predictions = self.predictor(image[:, :, ::-1], bbox) landmarks = np.array([(pt.x, pt.y) for pt in predictions.parts()], - dtype=np.float) + dtype=float) bbox = np.array([[bbox.left(), bbox.top()], [bbox.right(), bbox.bottom()]], - dtype=np.float) + dtype=float) detected.append(Face(bbox, landmarks)) return detected @@ -77,7 +77,7 @@ def _detect_faces_face_alignment_dlib(self, predictions = [] detected = [] for bbox, landmarks in zip(bboxes, predictions): - bbox = np.array(bbox, dtype=np.float).reshape(2, 2) + bbox = np.array(bbox, dtype=float).reshape(2, 2) detected.append(Face(bbox, landmarks)) return detected From 175a2eda13a887a806905ca47526217616e23f56 Mon Sep 17 00:00:00 2001 From: SachaDee Date: Fri, 28 Jun 2024 20:59:39 -0300 Subject: [PATCH 2/2] Update face_landmark_estimator.py as type 'int32' --- ptgaze/head_pose_estimation/face_landmark_estimator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ptgaze/head_pose_estimation/face_landmark_estimator.py b/ptgaze/head_pose_estimation/face_landmark_estimator.py index 770ea75..8238eed 100644 --- a/ptgaze/head_pose_estimation/face_landmark_estimator.py +++ b/ptgaze/head_pose_estimation/face_landmark_estimator.py @@ -103,8 +103,8 @@ def _detect_faces_mediapipe(self, image: np.ndarray) -> List[Face]: for prediction in predictions.multi_face_landmarks: pts = np.array([(pt.x * w, pt.y * h) for pt in prediction.landmark], - dtype=np.float64) + dtype=float) bbox = np.vstack([pts.min(axis=0), pts.max(axis=0)]) - bbox = np.round(bbox).astype(np.int32) + bbox = np.round(bbox).astype('int32') detected.append(Face(bbox, pts)) return detected