Skip to content

Commit

Permalink
Merge pull request #86 from regulaforensics/fix_identification_module
Browse files Browse the repository at this point in the history
Fix identification module
  • Loading branch information
KirylKovaliov authored Dec 12, 2023
2 parents 4a0bea9 + 6674fe6 commit 616727a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion regula/facesdk/webclient/ext/api/person_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ def __init__(self, api_client: ApiClient):

def add_image_to_person(self, person_id: str, content: bytes, content_type: str = None, **kwargs) -> Image:
base_image = base64.b64encode(content).decode("UTF-8")
image = ImageFields(ImageFieldsImage(content_type, base_image))
image = ImageFields(image=ImageFieldsImage(content_type, base_image))
return super().add_image_to_person(person_id, image, **kwargs)

def create_person(self, person_fields: PersonFields, **kwargs) -> Person:
if person_fields.metadata is None:
person_fields.metadata = {}
return super().create_person(person_fields, **kwargs)

def delete_image_of_person(self, image_id: str, person_id: str, **kwargs) -> None:
Expand Down
2 changes: 1 addition & 1 deletion regula/facesdk/webclient/ext/api/search_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ def __init__(self, api_client: ApiClient):
def search(self, search_request: SearchRequest, **kwargs) -> SearchResult:
image = search_request.image
if image is not None:
search_request.image.content = base64.b64encode(image.content).decode("utf-8")
search_request.image.content = base64.b64encode(image.content).decode("utf-8") if image.content else None
return super().search(search_request, **kwargs)

0 comments on commit 616727a

Please sign in to comment.