Skip to content
English
  • There are no suggestions because the search field is empty.

How to add an additional face to existing person

Adding a 2nd face to existing person record can improve recognition.  This article explains how to add more than one face image to an existing identity.  


1. Add Person with POST /people using following to ensure not merged to existing person:

  • Query parameters insert=true&update=false 
  • header X-RPC-FACES-GROUPING-THRESHOLD: 0

Example:

curl -k -X POST curl ""https://127.0.0.1:8081/people?update=false&insert=true&merge=false"" -H ""accept: application/json;charset=UTF-8"" -H ""X-RPC-DIRECTORY: main"" -H ""X-RPC-FACES-GROUPING-THRESHOLD: 0"" -H ""X-RPC-AUTHORIZATION: $USER:$PASS"" -H ""Content-Type: image/jpeg"" --data-binary @new_face.jpg

The value of X-RPC-FACES-GROUPING-THRESHOLD must be equal to 0 (zero) which forces SAFR  to match any existing faces (most importantly the target face which is presumably the same person).


You may also need to set min-cpq, min-fcq, min-fsq and occlusion parameters to prevent image from being rejected due to quality, though it is recommended to maintain minimum quality of face images added to SAFR to avoid increasing false match rate.


2. Get the person ID from the response (call this newPersonId)


3. Get any other merged faces from the existing person with GET /mergedpeople/{personId}

  • This returns an array called ‘people’


4. Get value of mergedWith from each and put in an array.  Store this in mergeList


5. Append newPersonId to mergeList


6. Use the PUT /merge API and pass mergeList in body


Note: This behavior creates TWO DIFFERENT identities and then links to two into a parent/child relationship.  In the SAFR People Window, it will appear as one identity with faces nested underneath it.  One of the identities is set as the ""root"" identity with the rootPersonId.