Skip to content

How to Install Face API SDK on Linux

Prerequisites

To install the Face SDK, you need to have a 64-bit version of one of these following platforms:

  • Ubuntu 20.04+
  • Debian 11+
  • Red Hat Enterprise Linux 8.5+ (including all binary-compatible RHEL alternatives)

    SDK vs OSes support SDK vs OSes support SDK vs OSes support

Info

The SDK is supported on x86_64 or (amd64) architectures.

Available Packages

The Face SDK Web API service is available in two configurations - CPU/GPU, and distributed via the following packages:

  • face-rec-service-cpu
  • face-rec-service-gpu

GPU package prerequisites

Installing Over Older Version

When upgrading the SDK, it's important to consider how the new version will handle the existing configuration files.

In the command line, if you select Y or I during installation, the configuration files are updated to use the new Face SDK version. However, the old .env file is preserved and renamed to .env.dpkg-old.

If N or O (default installation) is selected, the old .env file is used to configure the new version, and the new file is saved under the name .env.dpkg-dist. The option D displays the difference between the files, while Z launches shell.

To automate the installation process, the following command can be used:

yes I | sudo dpkg -i face-rec-service-cpu-5.2.deb

When installing the rmp package, the old configuration file .env is preserved, and the new file is saved as .env.rpmnew. You can configure the new version without losing any previous changes.

Basic Installation

Install using the repository

To set up the repository, update the apt package index and install packages to allow apt using the repository over HTTPS:

sudo apt-get update
sudo apt-get install -y \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

Add the Regula official GPG key:

curl -fsSL https://downloads.regulaforensics.com/repo/ubuntu/regula.gpg | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/regula.gpg --import
curl -fsSL https://downloads.regulaforensics.com/repo/debian/regula.gpg | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/regula.gpg --import
sudo chmod 644 /etc/apt/trusted.gpg.d/regula.gpg

Use the following command to set up the stable repository:

sudo add-apt-repository \
"deb [arch=amd64] https://downloads.regulaforensics.com/repo/ubuntu \
$(lsb_release -cs) \
stable"
sudo add-apt-repository \
"deb [arch=amd64] https://downloads.regulaforensics.com/repo/debian \
$(lsb_release -cs) \
stable"

Update the apt package index and install the latest version of the SDK, or go to the next step to install a specific version:

sudo apt-get update
sudo apt-get install face-rec-service-cpu
sudo apt-get install face-rec-service-gpu

To install a specific version of the SDK, list the available versions in the repo, then select and install the required version.

a. List the versions available in your repo:

apt-cache madison face-rec-service-cpu
apt-cache madison face-rec-service-gpu

b. Install a specific version using the version string from the second column:

sudo apt-get install face-rec-service-cpu=<VERSION>
sudo apt-get install face-rec-service-gpu=<VERSION>

To set up the repository, install the yum-utils package (which provides the yum-config-manager utility) and set up the stable repository.

sudo yum update
sudo yum install -y yum-utils
sudo yum-config-manager \
    --add-repo \
    https://downloads.regulaforensics.com/repo/centos/regula.repo

Install the latest version of the SDK or go to the next step to install a specific version:

sudo yum install face-rec-service-cpu
sudo yum install face-rec-service-gpu

To install a specific version of the SDK, list the available versions in the repo, then select and install the required version.

a. List the versions available in your repo:

sudo yum list face-rec-service-cpu --showduplicates | sort -r
sudo yum list face-rec-service-gpu --showduplicates | sort -r

b. Install a specific version by its fully qualified package name:

sudo yum install face-rec-service-cpu-<VERSION>
sudo yum install face-rec-service-gpu-<VERSION>

Installing from a package

Note

Regula packages require the following dependencies to be installed before the SDK is downloaded: debconf (>= 0.2.26), libusb-1.0-0 (>= 2:1.0.20), udev, pcscd, libccid.

Open Regula download page and download the .deb file for the SDK version you want to install:

wget https://downloads.regulaforensics.com/repo/ubuntu/pool/stable/f/face-rec-service-cpu/<package>.deb
wget https://downloads.regulaforensics.com/repo/ubuntu/pool/stable/f/face-rec-service-gpu/<package>.deb

Open Regula download page and download the .deb file for the SDK version you want to install:

wget https://downloads.regulaforensics.com/repo/debian/pool/stable/f/face-rec-service-cpu/<package>.deb
wget https://downloads.regulaforensics.com/repo/debian/pool/stable/f/face-rec-service-gpu/<package>.deb

Install the SDK:

sudo dpkg -i <package>.deb

Note

Regula packages require the following dependencies to be installed before SDK is downloaded: libusb, pcsc-lite, libX11.

Open Regula download page and download the .rpm file for the SDK version you want to install:

wget https://downloads.regulaforensics.com/repo/centos/x86_64/stable/Packages/<package>.rpm

Install the SDK:

sudo rpm -ivh <package>.rpm

Set license

To access all the capabilities of the Face Web API, you need to set a license.

To obtain the production license or get purchasing information, please submit an inquiry and our sales team will contact you shortly.

Note

Make sure that the regula.license file is located at your user's home directory "$HOME/regula.license".

1. Copy the regula.license file to the following folder:

sudo cp -ar ~/regula.license /opt/regula/face-rec-service/extBin/unix/

2. Restart the Face Web API service:

sudo systemctl restart face-rec-service.service

Advanced Installation

Advanced setup allows you to use the Liveness module, Identification module or both.

1. To use Face liveness, you should install and configure a database from the supported list and an S3-compatible object storage. Also, you need to specify FaceApi parameters for a database and storage via a YAML file, see the Configuration page for details.

2. Using the Face Identification module or Full Functionality is possible only with container`s method installation. Refer to the corresponding installation guides: Face Identification and Full Functionality.

Face liveness

Database

Below is an example how to install and configure PostgreSQL.

Refer to the Install PostgreSQL for Linux platforms.

Configure PostgreSQL:

# Add user `postgres` to sudo group:
sudo adduser postgres sudo

# Switch to the `postgres` user:
sudo su - postgres

# Create a DB user `regula` with an example password 'Regulapasswd#1':
createuser regula -d -P

# Create a DB `regula_db`:
createdb regula_db -O regula

Storage

You can use your existing S3 compatible object storage or use local file system storage as in our example.

FaceApi

Edit the config.yaml file located at the /opt/regula/face-rec-service folder and set parameters:

service:

  storage:
    type: "fs"

  database:
    connectionString: "postgresql://regula:Regulapasswd#1@127.0.0.1:5432/regula_db"

  liveness:
    enabled: true
    ecdhSchema: "default"
    hideMetadata: false
    sessions:
      location:
        folder: "data/faceapi-sessions"

Restart the Face Web API service:

sudo systemctl restart face-rec-service.service

Verify Face Web API Service:

sudo systemctl status face-rec-service

Database

Below is an example how to install and configure PostgreSQL.

Refer to the Install PostgreSQL for Linux platforms

Configure PostgreSQL:

# Add user `postgres` to wheel group
sudo usermod -aG wheel postgres

# Switch to the `postgres` user
sudo su - postgres

# Create a DB user `regula` with an example password 'Regulapasswd#1':
createuser regula -d -P

# Create a DB `regula_db`
createdb regula_db -O regula

Storage

You can use your existing S3 compatible object storage or use local file system storage as in our example.

FaceApi

Edit the config.yaml file located at the /opt/regula/face-rec-service folder and set parameters:

service:

  storage:
    type: "fs"

  database:
    connectionString: "postgresql://regula:Regulapasswd#1@127.0.0.1:5432/regula_db"

  liveness:
    enabled: true
    ecdhSchema: "default"
    hideMetadata: false
    sessions:
      location:
        folder: "data/faceapi-sessions"

Restart the Face Web API service:

sudo systemctl restart face-rec-service.service

Verify Face Web API Service:

sudo systemctl status face-rec-service