Face Recognition

Run Docker Image

  • You need to get credentials to our Gitlab registry first before executing the commands below. Contact our sales for inquiry.

  • After you get credential, insert your credential to docker registry:

sudo docker login registry.gitlab.com -u <username> -p <token>
  • GPU Version requires NVidia CUDA backend, you need to install nvidia-docker first.

  • Pull the docker image

sudo docker pull registry.gitlab.com/nodefluxio/core-stream/fremisn:1.0.1-rc2
  • To run GPU version:

sudo docker run \
-it -p 4004:4004 \
-d --name fremisn \
registry.gitlab.com/nodefluxio/core-stream/fremisn:1.0.1-rc2 \
httpserver \
--access-key "YOUR_CLOUD_ACCESS_KEY" \
--secret-key "YOUR_CLOUD_SECRET_KEY" \
--verbose
  • To stop container, run:

docker stop nodeflux-fremisn

APIs

Postman

Click link below to get Postman Collection.

Set Keyspace

The face enrollment API is served in the following endpoint:

POST <ADDRESS>:<PORT>/v1/face/keyspace

Request

{
"keyspace": "{YOUR_ACCOUNT_NAME}"
}

Response

{
"keyspace": "{YOUR_ACCOUNT_NAME}"
}

Payload Request

Create Enrollment

The face enrollment API is served in the following endpoint:

POST <ADDRESS>:<PORT>/v1/face/enrollment

Request

{
"image": "{BASE64_IMAGE}",
"keyspace": "{YOUR_ACCOUNT_NAME}"
}

Response

{
"face_id":"30604573299179521",
"variation":"17952130604573299"
}

Face Recognition

The face enrollment API is served in the following endpoint:

POST <ADDRESS>:<PORT>/v1/face/recognition

Request

{
"keyspace": "{YOUR_ACCOUNT_NAME}",
"image": "{INSERT_JPEG_IMAGE_AS_BASE64_STRING}",
"additional_params": {
"candidateCount": 2
}
}

Response

{
"result": {
"face_recognition": [
{
"candidates": [
{
"face_id":"30604573299179521",
"similarity": 1,
"variation":"17952130604573299"
},
{
"face_id":"30604573299175432",
"similarity": 0.81,
"variation":"17952130604573292"
}
]
}
]
}
}

Custom Enrollment

The face enrollment API is served in the following endpoint:

POST <ADDRESS>:<PORT>/v1/face/enrollment

Request

{
"image": "{BASE64_IMAGE}",
"keyspace": "{YOUR_ACCOUNT_NAME}",
"additional_params": {
“face_id”:”123456789101112”
}
}

Response

{
"face_id":"123456789101112",
"variation":"17952130604573299"
}

Delete Enrollment

The face enrollment API is served in the following endpoint:

POST <ADDRESS>:<PORT>/v1/face/delete-enrollment

Request

{
"keyspace": "{YOUR_ACCOUNT_NAME}",
"face_ids": [
"71111845645123585"
]
}

Response

{
"deleted_face_ids": [
"71111845645123585",
"71111845645123585",
"71111845645123585"
]
}