Skip to content

Advanced Installation

Advanced setup is based on the integration with PostgreSQL DB & Milvus vector database. For basic setup, visit the Basic Installation page.

❗ As Milvus is quite demanding, you need to plan the infrastructure in advance. Before you install Milvus, check your hardware and software to see if they meet the requirements:

For further performance and integration fine tuning, refer to the official Milvus documentation.

To install Docker Compose, refer to the official guide.

Face liveness

Download liveness-docker-compose.yml and save it as docker-compose.yml:

wget https://docs.regulaforensics.com/develop/face-sdk/web-service/installation/files/liveness-docker-compose.yml -O docker-compose.yml

To set the license, place the regula.license file into the same folder where the downloaded docker-compose.yml is located.

To start FaceAPI with liveness, invoke:

sudo docker compose up -d
[+] Running 6/6
⠿ Network regula_faceapi-network          Created
⠿ Volume "regula_minio-data"              Created
⠿ Volume "regula_postgre-data"            Created
⠿ Container minio                         Started
⠿ Container db-postgres                   Started
⠿ Container faceapi                       Started

Check the status:

sudo docker compose ps
NAME                            COMMAND                  SERVICE             STATUS              PORTS
db-postgres                     "/opt/bitnami/script…"   db-postgres         running             0.0.0.0:5432->5432/tcp
faceapi                         "./entrypoint.sh"        faceapi             running             0.0.0.0:41101->41101/tcp
minio                           "/usr/bin/docker-ent…"   minio               running (healthy)   0.0.0.0:9000-9001->9000-9001/tcp

To stop FaceAPI with liveness, run:

sudo docker compose down

To delete data after stopping FaceAPI with liveness:

sudo docker compose down -v

Face identification

Download identification-docker-compose.yml and save it as docker-compose.yml:

wget https://docs.regulaforensics.com/develop/face-sdk/web-service/installation/files/identification-docker-compose.yml -O docker-compose.yml

To set the license, place the regula.license file into the same folder where the downloaded docker-compose.yml is located.

To start FaceAPI with identification, invoke:

sudo docker compose up -d
[+] Running 11/11
⠿ Network regula_faceapi-network           Created
⠿ Volume "regula_postgre-data"             Created
⠿ Volume "regula_minio-data"               Created
⠿ Volume "regula_etcd-data"                Created
⠿ Volume "regula_milvus-data"              Created
⠿ Container milvus-etcd                    Started
⠿ Container db-postgres                    Started
⠿ Container milvus-minio                   Started
⠿ Container milvus-standalone              Started
⠿ Container milvus-attu                    Started
⠿ Container faceapi                        Started

Check the status:

sudo docker compose ps
NAME                            COMMAND                  SERVICE             STATUS              PORTS
db-postgres                     "/opt/bitnami/script…"   db-postgres         running             0.0.0.0:5432->5432/tcp
faceapi                         "./entrypoint.sh"        faceapi             running             0.0.0.0:41101->41101/tcp
milvus-attu                     "docker-entrypoint.s…"   attu                running             0.0.0.0:3000->3000/tcp
milvus-etcd                     "etcd -advertise-cli…"   etcd                running             2379-2380/tcp
milvus-minio                    "/usr/bin/docker-ent…"   minio               running (healthy)   0.0.0.0:9000-9001->9000-9001/tcp
milvus-standalone               "/tini -- milvus run…"   milvus-standalone   running             0.0.0.0:9091->9091/tcp, 0.0.0.0:19530->19530/tcp

To stop FaceAPI with identification, run:

sudo docker compose down

To delete data after stopping FaceAPI with identification:

sudo docker compose down -v

Full functionality

To use the full functionality of our FaceAPI web service, download full-docker-compose.yml and save it as docker-compose.yml:

wget https://docs.regulaforensics.com/develop/face-sdk/web-service/installation/files/full-docker-compose.yml -O docker-compose.yml

To set the license, place the regula.license file into the same folder where the downloaded docker-compose.yml is located.

To start FaceAPI, invoke:

sudo docker compose up -d
[+] Running 11/11
⠿ Network regula_faceapi-network           Created
⠿ Volume "regula_milvus-data"              Created
⠿ Volume "regula_postgre-dataa"            Created
⠿ Volume "regula_minio-dat"                Created
⠿ Volume "regula_etcd-data"                Created
⠿ Container db-postgres                    Started
⠿ Container milvus-minio                   Started
⠿ Container milvus-etcd                    Started
⠿ Container milvus-standalone              Started
⠿ Container milvus-attu                    Started
⠿ Container faceapi                        Started

Check the status:

sudo docker compose ps
NAME                            COMMAND                  SERVICE             STATUS              PORTS
db-postgres                     "/opt/bitnami/script…"   db-postgres         running             0.0.0.0:5432->5432/tcp
faceapi                         "./entrypoint.sh"        faceapi             running             0.0.0.0:41101->41101/tcp
milvus-attu                     "docker-entrypoint.s…"   attu                running             0.0.0.0:3000->3000/tcp
milvus-etcd                     "etcd -advertise-cli…"   etcd                running             2379-2380/tcp
milvus-minio                    "/usr/bin/docker-ent…"   minio               running (healthy)   0.0.0.0:9000-9001->9000-9001/tcp
milvus-standalone               "/tini -- milvus run…"   milvus-standalone   running             0.0.0.0:9091->9091/tcp, 0.0.0.0:19530->19530/tcp

To stop FaceAPI, run:

sudo docker compose down

To delete data after stopping FaceAPI:

sudo docker compose down -v

Face liveness

Download an example liveness-values.yaml file:

wget https://docs.regulaforensics.com/develop/face-sdk/web-service/installation/files/liveness-values.yaml

Create a face-api-license secret from the regula.license file:

kubectl create secret generic face-api-license --from-file=regula.license

Note

The regula.license file should be located in the same folder where the kubectl create secret command is executed.

Create a certificates secret from tls.crt/tls.key files:

kubectl create secret tls certificates --key="tls.key" --cert="tls.crt"

Note

tls.crt/tls.key files should be located in the same folder where the kubectl create secret command is executed.

Deploy minio or create AWS S3 bucket and IAM User with programmatic access (AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY).

Fill in the downloaded liveness-values.yaml file with data you got in the previous step:

storage:
  ## Pass your S3 compatible storage endpoint details
  endpoint: <http://host:port for minio or https://s3.YOUR_BUCKET_REGION.amazonaws.com>
  ## Pass your MINIO_ROOT_USER or AWS_ACCESS_KEY_ID
  accessKey: <MINIO_ROOT_USER/AWS_ACCESS_KEY_ID>
  ## Pass your MINIO_ROOT_PASSWORD or AWS_SECRET_ACCESS_KEY
  secretKey: <MINIO_ROOT_PASSWORD/AWS_SECRET_ACCESS_KEY>
  ## Pass AWS S3 bucket region
  region: <YOUR_BUCKET_REGION>
  ## Pass AWS S3 bucket name
  sessionBucketName: <YOUR_BUCKET_NAME>

To install the chart with the release name my-release:

helm install my-release regulaforensics/faceapi -f liveness-values.yaml

Face identification

Download an example identification-values.yaml file:

wget https://docs.regulaforensics.com/develop/face-sdk/web-service/installation/files/identification-values.yaml

Create a face-api-license secret from the regula.license file:

kubectl create secret generic face-api-license --from-file=regula.license

Note

The regula.license file should be located in the same folder where the kubectl create secret command is executed.

To install the chart with the release name my-release:

helm install my-release regulaforensics/faceapi -f identification-values.yaml

Note

The faceapi chart uses a milvus subchart underneath. For advanced Milvus configuration, please refer to the official documentation: https://github.com/milvus-io/milvus-helm/tree/milvus-4.0.8/charts/milvus#milvus-helm-chart.

Full functionality

Download an example full-functionality-values.yaml file:

wget https://docs.regulaforensics.com/develop/face-sdk/web-service/installation/files/full-functionality-values.yaml

Create a face-api-license secret from the regula.license file:

kubectl create secret generic face-api-license --from-file=regula.license

Note

The regula.license file should be located in the same folder where the kubectl create secret command is executed.

To install the chart with the release name my-release:

helm install my-release regulaforensics/faceapi -f full-functionality-values.yaml

Note

The faceapi chart uses a milvus subchart underneath. For advanced Milvus configuration, please refer to the official documentation: https://github.com/milvus-io/milvus-helm/tree/milvus-4.0.8/charts/milvus#milvus-helm-chart.

GPU version

The GPU version has dramatically higher performance in comparison with the CPU version.

Prerequisites

version: gpu

resources:
  requests:
    nvidia.com/gpu: 1
  limits:
    nvidia.com/gpu: 1

External dependencies

FaceAPI can be configured to use external dependencies.

External PostgreSQL

External PostgreSQL can be configured via the following values:

  1. externalPostgreSQL (e.g. postgresql://user:pass@host:5432/database)

  2. externalPostgreSQLSecret - (e.g. postgresql://user:pass@host:5432/database value taken from secret - secure way)