diff --git a/scripts/extract_faces.py b/scripts/extract_faces.py index 19f0993..e4fad15 100644 --- a/scripts/extract_faces.py +++ b/scripts/extract_faces.py @@ -1,4 +1,5 @@ import json; +import sys; from deepface import DeepFace; try: diff --git a/scripts/represent.py b/scripts/represent.py index a7c675f..b14364f 100644 --- a/scripts/represent.py +++ b/scripts/represent.py @@ -1,4 +1,5 @@ import json; +import sys; from deepface import DeepFace; result = DeepFace.represent( diff --git a/scripts/verify.py b/scripts/verify.py index 312eefa..cd6d9ec 100644 --- a/scripts/verify.py +++ b/scripts/verify.py @@ -1,4 +1,5 @@ import json; +import sys; from deepface import DeepFace; try: diff --git a/src/DeepFace.php b/src/DeepFace.php index 5bb2b4e..657568f 100644 --- a/src/DeepFace.php +++ b/src/DeepFace.php @@ -57,7 +57,7 @@ public function verify( bool $align = true, Normalization $normalization = Normalization::BASE, bool $anti_spoofing = false, - ): VerifyResult { + ): VerifyResult|array { $img1 = new SplFileInfo($img1_path); $img2 = new SplFileInfo($img2_path); @@ -85,6 +85,7 @@ public function verify( ], ); } catch(DeepFaceException $e){ + // if any of these images fails the spoof detection, it will throw 'Exception while processing imgX_path' return array("error" => $e->getMessage()); }