Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
How to start the Docker container
Our Docker image can run on x86-64 CPU.
Follow the instructions below to run the server docker.
As the first step, you need to load the Docker image from the provided file.
After loading the image, you can start the server via the script below. This script will start a docker container with the Server image and copy the license and server-config information into that container:
Once the server is running, you can access the API documentation/OpenAPI Swagger Docs page by going to a browser on the local machine via:
The Swagger Docs page is useful to test the web APIs from your browser. The Swagger framework allows developers to create interactive, machine and human-readable API documentation. It is the framework that REST API developers are most familiar with.
We also provide RapiDoc documentation that is better looking and easier to read:
Every time a Docker container is restarted, it assumes a new ID. Since only 5 concurrent IDs are allowed (by default) in the license, you might encounter an error if you frequently start/stop the Docker images. Thus, it is recommended to start a Docker image only once and let it run.
With a fast setup, easy deployment, and low-maintenance architecture, Seventh Sense’s solution allows businesses to integrate cutting-edge face recognition capabilities with minimum operational complexity.
This document is an easy-to-implement guide for the OpenCV FR Server.
Seventh Sense’s Server is a face recognition server solution that provides world-class accuracy with GPU-level performance on CPU hardware. Designed for seamless integration and high-performance verification. Seventh Sense's technology enables businesses to enhance security and streamline authentication for attendance checking, access control, eKYC, and onboarding use cases.
To get access to the OpenCV FR Server, please reach out at (support@seventhsense.ai), Our team will assist you through the onboarding process and provide you with a test license.
Note: If you are interested in how to verify a face in a privacy-preserving and secure way, check out our .
Create collection
Delete collection
Get collection list
Enroll/Update a single person - liveness check available
Enroll/Update a batch of persons
Delete a person
Get a single or list of person
1:N face search - liveness check available
1:N face verification with a given person_id - liveness check available
N:N face search
Before performing Face Search (1:N, N:N), you first need to create a collection and enroll the persons in a specific collection.
Each collection is a table, collection name should be unique, it’s not allowed to create two collections with the same name.
Upon a collection being created, the collection name is not allowed to change. you can delete a collection, in this case, all enrolled persons within the collection will be deleted as well, so please be careful.
POST
/collection
This endpoint is to create a collection
Headers
Body
Response
DELETE
/collection
This endpoint is to delete a collection.
Headers
Body
Response
(1:N, N:N)
- liveness check available
name
Required: Yes
Type: string
Example:
Each collection is like a table, the name of the collection is the unique identifier.
Once created, no modification of the name is allowed.
name
Required: Yes
Type: string
Example:
Each collection is like a table, upon deletion of a collection, all enrolled person within the collection will be deleted.
Information about licensing and authentication for the server
The licensing for the server is governed by a license file called server.lic
. This file is located in the root folder of the distribution bundle.
The server.lic
file determines quotas and limits for the system. During development, the initial file should provide enough quotas for your needs. As you approach a production deployment, please contact Seventh Sense for a review of your quota needs.
When the server is running, it offers several end-points that can be called via HTTP clients in a language of your choice.
To access these server end-points, please use your api_key
A random API key was included in the server-config.toml
file mentioned in the previous section. Including it in requests using the x-api-key
header will help authorize your requests.
How the Swagger Docs page can be used to quickly test the APIs
Assuming that you have been able to successfully start the Docker and access the Swagger Docs page via:
The following describes how to use the Swagger Docs page. The Swagger Docs page makes http(s) calls via your browser. Hence, everything detailed below can also be accomplished using an http library in a programming language of your choice.
The page also provides cURL commands that you can execute from the command line to send requests and receive responses.
Each API end-point in the Swagger Docs page requires an x-api-key
header for authorisation.
For your convenience, the Swagger Docs page allows you to authorise via the UI in a browser.
This is demonstrated in the next section.
Logging in!
Upon opening the Swagger Docs page in the browser, you should see the Authorize
button on the top right:
Now we can use the Swagger Docs page to interact with the API.
OpenCV FR supports a wide range of use cases
Below are key use cases for each feature:
Face Search allows the identification of individual(s) by searching their face against a database of enrolled users.
Automated Attendance Checking – Verify and record employee/student attendance without requiring manual check-ins, reducing fraud and streamlining workforce management.
Customer Onboarding – Match a new customer’s ID photo, face and/or photo against an ID database to prevent identity fraud.
Smart Access Control – Grant access to employees or VIPs by registering and verifying their faces.
Law Enforcement & Security – Identify persons of interest from CCTV footage.
Casino Security & VIP Player Identification – Identify known fraudsters, excluded gamblers, or VIP guests in real time to enhance security.
User submits an image with single or multiple faces
The system searches for match(es) in the database
If matches are found, the system returns the identified person(s) with a confidence score.
Face Compare allows the authentication of identities by comparing two face images and determining if they are the same person.
eKYC & Identity Verification – Match a user’s selfie with their government-issued ID photo to authenticate identity during onboarding.
Passwordless Authentication & Secure Logins – Replace traditional passwords with facial authentication for secure app access.
Border Control & Travel – Compare a traveler’s live face with their passport or visa photo for automated identity verification.
Payment & High-Value Transactions – Verify users for banking transactions to prevent fraud.
User provides two face images.
The system computes a similarity score.
If the score is above a predefined threshold, the faces are considered a match.
Liveness Detection ensures that the face being analyzed belongs to a live person, not a photo, video, or 3D mask.
Remote Attendance Checking – Ensure employees, students, or participants are physically present during check-ins, preventing fraudulent logins using photos or videos.
eKYC & Identity Verification – Prevent identity fraud by ensuring that a real person is taking the selfie during onboarding.
Fraud Prevention in Fintech & Banking – Block fraudulent transactions by ensuring a live user is making a request, not a deepfake or stolen photo.
E-Government Services – Secure digital identity verification for national ID programs and voting systems.
Online Exam Proctoring – Verify student presence in remote exams and prevent cheating using pre-recorded videos or fake faces.
User submits a photo for Liveness Detection as part of one of the following functions: Person Enrollment, Face Search (1:N), or Face Compare (1:1).
The system performs Liveness Detection alongside Face Recognition to verify identity and ensure the user is physically present.
If both Face Recognition and Liveness Detection pass, the system approves the action (e.g., enrolls the user, confirms identity, or logs attendance).
✅ Top ranked on NIST, no need for expensive GPUs. ✅ Fast setup, easy deployment in minutes. ✅ Works efficiently with millions of Faces. ✅ Privacy-first & GDPR-compliant.
Recall that we had set the API key in the file while starting the Docker. You will need to enter that API key after clicking the Authorize
button:
Seventh Sense's Face Recognition API provides a powerful and scalable solution for a wide range of applications. The solution offers and , both features provide options to enable Liveness Detection.
How to set the configuration for your server
The server is configured via a file named server-config.toml
. This file is included in the root of the distribution package that you have received and was automatically used when you started the server. You can, however, customize the values in this file and then restart the server. Below are the important configurations-
If you change the values in server-config.toml
, you will need to stop the container and restart it again.
First list the containers:
After observing the value for CONTAINER ID
, from the output of docker ps command, you can stop it using:
Once the docker is stopped, you can start it again using the process described in
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 multiple faces are been searched, the search results are returned in order of decreasing similarity score, as long the specified min_score threshold (default is 0.7) is met.
POST
/face-search
This endpoint is for 1:N search of one face in an image within a collection
Headers
Body
check_liveness
Required: yes
Type: boolean Default value: false Accepted values: false, true
Example:
collection_name
Required: Yes
Type: string Example:
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:
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:
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:
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
collection_name
Required: Yes
Type: string Example:
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:
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:
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
To prevent fraud using high-resolution printouts, masks, or video replays, the liveness image imposes stricter requirements on the image. Liveness image requirement:
Our API processes the area around the face, so the optimal resolution will depend on the image content. Assuming a portrait orientation, with the face centered and taking at least 1/4 of the image area, the minimum image resolution is SVGA (600x800). In general, images captured in higher resolution will result in better accuracy.
The minimum size of a face box that can be processed is 150x150 pixels.
The padding between the face box and the image's borders should be at least 15 pixels.
The distance between the pupils on the face should be at least 50 pixels.
The out-of-plane rotation angle (face pitch and yaw) should be no more than ±30 degrees.
There should only be one main face on the image. It should be fully visible within a frame and fully
Fish-eye lenses and sunglass images are not supported.
Face Compare API allows you to compare two face images to determine if they correspond to the same person. A score higher than 0.7 is a good indicator that the two images belong to the same person.
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). The score is a number between 0 and 1, where 1 is a perfect match and 0 is a perfect mismatch. The score is calculated using a deep learning model trained on millions of face images.
If the liveness check is enabled in the provided server, you can check the liveness with the face compare feature in a single API call.
POST
/compare
This endpoint is for 1:1 face compare, no person enrollment needed
Headers
Body
Response
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
The liveness feature in the OpenCV FR Server is integrated into the , and functions. A standalone liveness check API is not available.
A face could not be detected in the image(s)
Please use an API Key to access this endpoint
API Key is invalid. Please provide a valid API Key
The collection with the specified name does not exist
Liveness error. The metadata contains the code that provides specifics about the error
Common codes are:
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
The images could not be decoded from base64
check_liveness
Required: yes
Type: boolean Default value: false Accepted values: false, true
Example:
face_base_64
Required: Yes
Type: string Example:
The image should contain a single face. Liveness will be checked on this face if enabled.
min_similarity_score
Required: Yes
Type: float Default value: 0.7 Example:
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).
ref_face_base_64
Required: Yes
Type: string Example:
Each reference image should contain a single face.
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
Content-Type
application/json
x-api-key
<your-api-key>
Content-Type
application/json
x-api-key
<your-api-key>
Content-Type
application/json
x-api-key
<your-api-key>
Content-Type
application/json
x-api-key
<your-api-key>
PUT
/persons
This endpoint is to enroll or update persons in bulk.
Headers
Body
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
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
Persons
Required: Yes
Type: dict Example: To enroll multiple persons in a specified collection:
Enrolling or updating multiple persons in one collection is allowed. Each Base64 image should have only one face. Not supporting multiple persons enrollment/update to multiple collections.
Response
The collection name specified is not valid
Please use an API Key to access this endpoint
API Key is invalid. Please provide a valid API Key
The collection with the specified name does not exist
The posted JSON is malformed or contains fields that are not of the correct type
An error occurred while connecting with the database, please retry your request later
Following the collection(s) creation, let's start enrolling some person(s) in the collection.
PUT
/person
Headers
Body
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
The collection name specified is not valid
Please use an API Key to access this endpoint
API Key is invalid. Please provide a valid API Key
The collection with the specified name does not exist
Another person with a similar face already exists in the collection
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
This endpoint is to enroll or update a single person. For bulk person enrollment, please refer to
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
Content-Type
application/json
x-api-key
<your-api-key>
Content-Type
application/json
x-api-key
<your-api-key>
1:N Face Search
N:N Face Search
A face could not be detected in the image(s)
Please use an API Key to access this endpoint
API Key is invalid. Please provide a valid API Key
The collection with the specified name does not exist
Liveness error. The metadata contains the code that provides specifics about the error
Common codes are:
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
The images could not be decoded from base64