Skip to main content
Version: 2.4.0 (latest)

Installation

Deployment preparation

Preparation

Image API is delivered in the distribution kit. The distribution kit contains files necessary for Image API deployment. The link to download the distribution kit and the attached license file are sent to the client by email.

Unpack the distribution kit and replace a license file face_sdk.lic to the setup folder. Further commands should be performed relative to the setup directory.

Configuration

Configuration fileDescription
./cfg/image-api.values.yamlA configuration file of Image API instance deployment
./cfg/package.settings.cfgA configuration file of dependencies for installation of Kubernetes cluster
./cfg/smc.settings.cfgA configuration file of Kubernetes cluster

1. Open a deployment configuration file ./cfg/smc.settings.cfg in a text editor and set values for the following variables:

  • apiserver_advertise_address is the internal IP address of the machine for deployment.
  • external_ip_address is the public IP address of the machine which DNS will be configured to.
note

If there is no public IP address, use the internal IP address.

2. Open a deployment configuration file ./cfg/image-api.values.yaml in a text editor and set values for the following variables:

  • ingress.host is a domain name used in ingress to route requests to Kubernetes services.

IP address for domain name <ingress.host> should be configured at DNS server.

Install dependencies

If the system has no Docker, Kubernetes or Helm, run the command below:

./cli.sh smc package install

Upload images

Upload docker-images image-api to local registry:

./cli.sh image-api load-images

Upload the smc docker images to your local registry:

./cli.sh smc load-images

Uploading can last for about five minutes.

Install and configure a cluster

To create and configure the cluster, run the following command:

./cli.sh smc install

This command is used to:

  1. Set docker and host network.
  2. Install the cluster.
  3. Install ingress-controller.
  4. Install flannel.

To use GPU, install nvidia-device-plugin:

./cli.sh smc nvidia install

To use Horizontal Pod Autoscaler, install metric-server:

./cli.sh smc metric-server install

To create image-api secrets in a cluster, run the command below:

./cli.sh image-api install-secrets

Cluster health check

After initializing the master node, make sure that all nodes are ready for operation. You can check this by running the command below:

kubectl get nodes

As a result, the following output will be displayed in the terminal:

NAME          STATUS      ROLES                  AGE     VERSION
master-node Ready control-plane,master 1d v1.23.8

Deployment

Install Image API to the cluster

Launch the script below to install Image API to the cluster:

./cli.sh image-api install

Then run the following command to get the deployment status:

kubectl get pods

As a result, the console will display a list of pods (deployment instances), their statuses, the number of restarts, and the pod age. The example of console output:

NAME                                                READY    STATUS     RESTARTS   AGE
image-api-age-estimator-dep-5bf7889dcd-jm46h 1/1 Running 0 1h
image-api-body-detector-dep-6778495696-4zkpm 1/1 Running 0 1h
image-api-emotion-estimator-dep-7c8cdd7c6b-z4vlv 1/1 Running 0 1h
image-api-face-detector-face-fitter-dep-5fb48dcb5… 1/1 Running 0 1h
image-api-gateway-dep-65d4846c59-g2nfj 1/1 Running 0 1h
image-api-gender-estimator-dep-86b9457f9b-2464q 1/1 Running 0 1h
image-api-face-detector-liveness-estimator-dep-7bd… 1/1 Running 0 1h
image-api-liveness-estimator-dep-9823475912-9xqfp 1/1 Running 0 1h
image-api-mask-estimator-dep-76b958b84b-w7pss 1/1 Running 0 1h
image-api-quality-assessment-estimator-dep-fbf8bc4… 1/1 Running 0 1h
image-api-face-detector-template-extractor-dep-57581/1 Running 0 1h
image-api-template-extractor-dep-6778489659-6zkmp4 1/1 Running 0 1h
image-api-verify-matcher-dep-6d66dc4948-lx8j7 1/1 Running 0 1h
note

Status Running for all pods shows that all containers are successfully launched.

Overview of the deployments is given below:

  • image-api-gateway-dep: reverse proxy, responsible for unified access to processing services.
  • image-api-face-detector-face-fitter-dep: face detection and calculation of anthropometric points and head rotation angles (roll, pitch, yaw).
  • image-api-body-detector-dep: body detection.
  • image-api-emotion-estimator-dep: estimation of emotions.
  • image-api-age-estimator-dep: age estimation.
  • image-api-gender-estimator-dep: gender estimation.
  • image-api-face-detector-liveness-estimator-dep: the service detects faces and checks if a person in the image is real or fake.
  • image-api-liveness-estimator-dep: the service checks if a person in the image is real or fake.
  • image-api-mask-estimator-dep: the service checks if a person in the image is wearing a medical face mask.
  • image-api-quality–assessment-estimator-dep: image quality assessment.
  • image-api-verify-matcher-dep: the service compares two biometric templates to verify whether they belong to the same person.
  • image-api-face-detector-template-extractor-dep: the service detects faces and extracts a biometric template from a face image.
  • image-api-template-extractor-dep: the service extracts a biometric template from a face image.

Configure DNS

To allow DNS access, your network server should contain a record that <domain> is available at <external_ip_address>. Variable values can be obtained from the ./cfg/smc.settings.cfg and ./cfg/image-api.values.yaml files filled in in para. Configuration. To perform this configuration, contact your network administrator.

For testing you can specify the IP address and domain in the /etc/hosts file on Linux or C:\Windows\System32\drivers\etc\hosts on Windows. To do this, add a new line <external_ip_address> <host> with the values of the corresponding variables to the end of this file. Please note that you must have administrator rights to edit the hosts file.

To use Image API at the same machine where it is deployed, you can use a script that will automatically add the necessary record to the /etc/hosts file.

echo "<external_ip_address> <host>" | sudo tee -a /etc/hosts

Testing

To make sure that the system works properly, use the command below:

./cli.sh image-api test - http://<host>

Test output should be the following:

face-detector-face-fitter ✓
age-estimator ✓
emotion-estimator ✓
gender-estimator ✓
face-detector-liveness-estimator ✓
liveness-estimator ✓
mask-estimator ✓
quality-assessment-estimator ✓
face-detector-template-extractor ✓
template-extractor ✓
body-detector ✓
verify-matcher ✓

Deletion

To delete Image API, run the command below:

./cli.sh image-api uninstall

Licensing

Install a license

Unpack Image API distribution kit and move a license file face_sdk.lic (the file is attached to the e-mail) to setup directory.

Update a license

  1. Reinstall the secrets:

    ./cli.sh image-api install-secrets
  2. Delete Image API release from the cluster:

    ./cli.sh image-api uninstall
  3. Install Image API release into the cluster:

    ./cli.sh image-api install