From 041f9aba19ef2db6f83d7c6ab6bd3ed8dd770528 Mon Sep 17 00:00:00 2001 From: acostapazo Date: Wed, 20 Dec 2023 13:37:45 +0100 Subject: [PATCH] chore: add headers as optional parameter to face document --- alice/face/face.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/alice/face/face.py b/alice/face/face.py index eff23f8..c6f43d8 100644 --- a/alice/face/face.py +++ b/alice/face/face.py @@ -72,10 +72,14 @@ def selfie( def document( self, image: bytes, + headers: Union[Dict[str, str], None] = None, ) -> Result[DocumentResult, FaceError]: + if headers is None: + headers = {} + response = self.session.post( url=f"{self.url}/document", - headers={"apikey": self.api_key}, + headers={"apikey": self.api_key} | headers, files={"image": image}, ) @@ -88,7 +92,6 @@ def match_profiles( self, face_profile_probe: bytes, face_profile_target: bytes, - # match_case: str = "document", ) -> Result[MatchResult, FaceError]: response = self.session.post( url=f"{self.url}/match/profiles", @@ -97,7 +100,6 @@ def match_profiles( "face_profile_probe": face_profile_probe, "face_profile_target": face_profile_target, }, - # data={"match_case": match_case}, TO BE DEPRECATED ) if response.status_code == 200: return Success(MatchResult(score=response.json().get("match_score")))