LogoLogo
  • Introduction
  • Use Cases
  • Getting Started
    • Starting the server
    • Configuration
    • Licensing and Authorization
    • Using the Swagger Docs page
    • Authorization
  • OpenCV FR Server
    • Collection Management
    • Person Management
      • Bulk Enroll or Update Persons
    • Face Search
    • Face Compare
    • Liveness Detection
Powered by GitBook
On this page
Export as PDF
  1. OpenCV FR Server

Person Management

PreviousCollection ManagementNextBulk Enroll or Update Persons

Last updated 2 months ago

Following the collection(s) creation, let's start enrolling some person(s) in the collection.

Add a person

PUT /person

This endpoint is to enroll or update a single person. For bulk person enrollment, please refer to

Headers

Body

Name
Description

person_id

Required: Yes

Type: string

Example:

Person id must be unique and defined, using same face with different person id will result duplicated record, be aware the person_id is case-sensitive.

person_name

Required: Yes

Type: string

Example:

Person name must be defined during enrollment. You can also update an enrolled person's name in later stage, as long the person_id remains the same

check_duplicates

Required: Yes

Type: boolean

Default value: false

Accepted values: false, true

Based on the set similarity score, this feature checks if there is a duplicated enrollment in a collection. If value set as true, enrolling a duplicate person is not allowed.

check_liveness

Required: Yes

Type: boolean

Default value: false

Accepted values: false, true

collection_name

Required: Yes

Type: string

Example:

Please create a collection first before enrolling person(s). Else an error "The requested entity could not be found." will return

duplicate_check_min_similarity

Required: Yes

Type: float

Default value: 0.7

Example:

It's recommended to keep the default value to check the duplicate enrollment. If "check_duplicates" set as false, "duplicate_check_min_similarity" will not be used

face_base_64

Required: Yes

Type: string

Example:

Use base64 encoded string to enroll the face, one image should have only one face

face_storage_type

Required: Yes

Type: string

Accepted values: "NoStorage", "StoreThumbnails", "StoreFullImage"

Example:

"NoStorage" = do not store any face image "StoreThumbnails" = store only thumbnails (cropped face from the given image) "StoreFullImage" = store full base64 image

metadata

Required: Optional

Type: dict

Example:

Metadata is a customizable field that allows to put additional info while enrolling a person. You can add N number customized fields for your use case.

Response

{
  "face_base_64": "string",
  "metadata": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "person_id": "string",
  "person_name": "string"
}

The collection name specified is not valid

{
  "code": "ERR_INVALID_COLLECTION_NAME",
  "message": "Collection names can only contain alphanumeric characters, underscores, hyphens, and periods."
}

Please use an API Key to access this endpoint

{
  "code": "ERR_API_KEY_NOT_PRESENT",
  "message": "The API key is missing from the request."
}

API Key is invalid. Please provide a valid API Key

{
  "code": "ERR_API_KEY_NOT_VALID",
  "message": "The API key is not valid."
}

The collection with the specified name does not exist

{
  "code": "ERR_NOT_FOUND",
  "message": "The requested entity could not be found."
}

Another person with a similar face already exists in the collection

{
  "code": "ERR_PERSON_ALREADY_EXISTS",
  "message": "Another person exists with a similar face. Check metadata for the person_id of the duplicate.",
  "metadata": {
    "person_id": "c96a1bc7-4c4e-497e-897f-c448a4a4be6a"
  }
}

Liveness error. The metadata contains the code that provides specifics about the error

EYES_CLOSED || FACE_CLOSE_TO_BORDER || FACE_CROPPED || FACE_NOT_LIVE || FACE_TOO_CLOSE || FACE_ANGLE_TOO_LARGE || FACE_IS_OCCLUDED || FACE_NOT_FOUND || FACE_TOO_SMALL || LICENSE_ERROR || TOO_MANY_FACES || UNKNOWN_ERROR

{
  "code": "ERR_LIVENESS_ERROR",
  "message": "A liveness error occurred. Please check the supplied image and the error metadata.",
  "metadata": {
    "code": "FACE_NOT_LIVE || .. || UNKNOWN_ERROR"
  }
}

If set to true, the liveness check is conducted during the person enrollment. If the person is successfully enrolled, means the face is live, else an error of "ERR_LIVENESS_ERROR" will return if face is not live, and person is not enrolled. Check

 "person_id": "F12345"
"person_name": "John Doe"
 "check_duplicates": false
"check_liveness": false
"collection_name": "SSAI"
"duplicate_check_min_similarity": 0.7
face_base_64": "U2Vjb25kIGltYWdl"
"face_storage_type": "NoStorage"
  "metadata": {
    "DOB": "2000-01-01",
    "Department": "Operation",
    "Nationality": "Singaporean",
    "Address": "101 Cecil Street, Singapore",
    ...
  }
liveness image requirement here
PUT/persons
Name
Value

Content-Type

application/json

x-api-key

<your-api-key>