Skip to content

Commit

Permalink
chore: add headers as optional parameter to face document
Browse files Browse the repository at this point in the history
  • Loading branch information
acostapazo committed Dec 20, 2023
1 parent f6774de commit 041f9ab
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions alice/face/face.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
)

Expand All @@ -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",
Expand All @@ -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")))
Expand Down

0 comments on commit 041f9ab

Please sign in to comment.