Face Search

We support both 1:N and N:N face search.

Within a collection, Face Search API allows you to search for previously registered persons using an image with a single that is obtained at a later time. The search is performed using a deep learning model trained on millions of face images. The search results are ranked by the similarity score, which is a number between 0 and 1, where 1 is a perfect match and 0 is a perfect mismatch. The max_results parameter is optional and allows you to control the maximum number of returned results. By default, it is set to 1, but you can customize this number for your specific use case.

If an image containing multiple faces is submitted for search, the results are returned in order of decreasing similarity score, provided each match meets the specified min_score threshold (default: 0.8).

POST /face-search

This endpoint is for 1:N search of one face in an image within a collection

Headers

Name
Value

Content-Type

application/json

x-api-key

<your-api-key>

Body

Name
Description

check_liveness

Required: yes

Type: boolean Default value: false Accepted values: false, true

Example:

"check_liveness": false,

If set to true, the liveness check is performed during 1:N face search if the face is found. If no face is found, liveness is not checked. Check liveness image requirement here

collection_name

Required: Yes

Type: string Example:

"collection_name": "MyCollection",

Face search is performed within a specified collection. If the person is not enrolled in that collection, the result will be empty.

face_base_64

Required: Yes

Type: string Example:

"face_base_64": "U2Vjb25kIGltYWdl",

Use a Base64-encoded string to perform a 1:N face search. Each image should contain only one face. For N:N face search, use POST /multi-face-search

min_similarity_score

Required: Yes

Type: float Default value: 0.7 Example:

"min_similarity_score": 0.7

The default value is a good indicator to confirm the match. You can also use a score of 0.67 or higher if the images are of the same person but taken at different times (years apart).

max_results

Required: Yes

Type: integer Example:

"max_results": 1,

The max_results parameter allows you to control the maximum number of returned results. By default, it is set to 1, but you can customize this number for your specific use case.

POST /multi-face-search

<This endpoint is for N:N search multiple faces in an image within a collection>

Body

Name
Description

collection_name

Required: Yes

Type: string Example:

"collection_name": "MyCollection",

Face search is performed within a specified collection. If the person is not enrolled in that collection, the result will be empty.

multi_face_img_base_64

Required: Yes

Type: string Example:

"multi_face_img_base_64": "U2Vjb25kIGltYWdl"

This enables searching for multiple faces within an image and retrieving results for all detected faces. If a face is not enrolled in the specified collection, its thumbnail will be returned without a similarity_score.

min_similarity_score

Required: Yes

Type: float Default value: 0.7 Example:

"min_similarity_score": 0.7

The default value is a good indicator to confirm the match. You can also use a score of 0.67 or higher if the images are of the same person but taken at different times (years apart).

Response

1:N Face Search

[
  {
    "face_base_64": "string",
    "metadata": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
    },
    "person_id": "string",
    "person_name": "string",
    "similarity_score": 0.1
  }
]

N:N Face Search

{
  "person_search_results": [
    {
      "person_id": "string",
      "person_name": "string",
      "metadata": {
      "additionalProp1": "string",
      "additionalProp2": "string",
      "additionalProp3": "string"
      },
      "face_base_64": "string",
      "similarity_score": 0.1
    }
  ],
  "unrecognized_face_thumbnails_base_64": [
    "string"
  ]
}

Last updated