From b6b52a916a5f6ac60f182155ef814bef88ba1a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ada=C3=ADas=20Magdiel?= Date: Mon, 22 Sep 2025 11:42:58 -0300 Subject: [PATCH] Fix: handle RetinaFace landmarks correctly (nose, mouth_left and mouth_right) This PR fixes [#23](https://github.com/Astrotomic/php-deepface/issues/23). - Issue: `Unknown named parameter $nose` when using `Detector::RETINAFACE` - Cause: RetinaFace returns landmarks (`nose`, `mouth_left`, `mouth_right`, etc.) not properly mapped. - Fix: Normalize landmark keys before constructing the object. Tested with: - `Detector::RETINAFACE` - `FaceRecognitionModel::ARCFACE` Result: `represent()` now returns embeddings successfully without crashing. --- src/Data/FacialArea.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Data/FacialArea.php b/src/Data/FacialArea.php index e9cb309..2aba405 100644 --- a/src/Data/FacialArea.php +++ b/src/Data/FacialArea.php @@ -13,6 +13,9 @@ public function __construct( public readonly int $h, public readonly int|array|null $left_eye, public readonly int|array|null $right_eye, + public readonly int|array|null $nose, + public readonly int|array|null $mouth_left, + public readonly int|array|null $mouth_right, ) {} public function jsonSerialize(): array