Skip to content
This repository was archived by the owner on Nov 8, 2021. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add recognition_model to create
Adds option to choose between newest and oldest recognition model. This affects how the model identifies faces and adds faces to persons. This does introduce possible errors as the recognition_model in the person_group has to match the recognition_model in face.detect.
  • Loading branch information
jhrystrom authored Apr 29, 2019
commit 12c0f679b34142054d00ac621815f52419725f48
11 changes: 9 additions & 2 deletions cognitive_face/person_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from . import util


def create(person_group_id, name=None, user_data=None):
def create(person_group_id, name=None, user_data=None, recognition_model=2):
"""Create a new person group with specified `person_group_id`, `name` and
user-provided `user_data`.

Expand All @@ -18,6 +18,9 @@ def create(person_group_id, name=None, user_data=None):
name: Person group display name. The maximum length is 128.
user_data: User-provided data attached to the person group. The size
limit is 16KB.
recognition_model: [Optional] Choose which model to use. At this moment
there are two possibilites: 1 (the original model) or 2 (the updated
model). Both should be input as an integer.

Returns:
An empty response body.
Expand All @@ -28,8 +31,12 @@ def create(person_group_id, name=None, user_data=None):
'name': name,
'userData': user_data,
}
params = {
'recognitionModel': "recognition_0"+str(recognition_model),
'returnRecognitionModel': 'true'
}

return util.request('PUT', url, json=json)
return util.request('PUT', url, json=json, params=params)


def delete(person_group_id):
Expand Down