How to Install Face API SDK on Linux
Processing versions types
- CPU
- GPU
Prerequisites
To install the Face SDK, you need to have a 64-bit version of one of these OS versions:
Ubuntu
- Ubuntu 16.04 (xenial) Supported up to version 3.2
- Ubuntu 18.04 (bionic)
- Ubuntu 20.04 (focal)
- Ubuntu 22.04 (jammy) Supported starting from version 4.0
Debian
- Debian 9 (Stretch)
- Debian 10 (Buster)
- Debian 11 (Bullseye)
CentOS
- CentOS 7
- CentOS 8
Info
The SDK is supported on x86_64 or (amd64) architectures.
Available packages
Face SDK Web API service is distributed via following packages:
- face-rec-service-cpu
- face-rec-service-gpu
GPU package prerequisites
- Install CUDA 11.4.2. Find the basic installation instructions in the NVIDIA CUDA documentation. Read on for more detailed instructions.
- Install NVIDIA graphics drivers (version >= 470). You can install drivers on your Linux system along with packages mentioned above or use the NVIDIA Driver Installation Guide.
- Install cuDNN 8.2.4.15. Find the step-by-step instructions on how to install cuDNN in the NVIDIA cuDNN Installation Guide.
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 apt-key add -
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"
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, 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/debian/regula.gpg | sudo apt-key add -
Use the following command to set up the stable repository:
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 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 https://downloads.regulaforensics.com/repo/ubuntu/pool/stable/f/, browse the required package dir 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
Install the SDK:
sudo dpkg -i <package>.deb
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 https://downloads.regulaforensics.com/repo/debian/pool/stable/f/, browse the required package dir 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.
Open https://downloads.regulaforensics.com/repo/centos/x86_64/stable/Packages/ 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
Advanced Installation
Advanced setup is based on the Basic installation and integration with PostgreSQL DB & Milvus vector database.
For further performance and integration fine tuning, refer to the official Milvus documentation.
Installing Milvus
You can install Milvus with APT on Ubuntu or alternatively with a .deb
package.
After installation, Milvus standalone and its dependencies (etcd and MinIO) start automatically. You can check their status:
sudo systemctl status milvus
sudo systemctl status milvus-etcd
sudo systemctl status milvus-minio
Download Minio Client (CLI):
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo cp -ar mc /usr/bin/
Create minio buckets:
mc config host add myminio http://localhost:9000 minioadmin minioadmin;
mc rm -r --force myminio/faceapi-person;
mc rm -r --force myminio/faceapi-session;
mc mb myminio/faceapi-person;
mc mb myminio/faceapi-session;
You can install Milvus with APT on Debian or alternatively with a .deb
package.
After installation, Milvus standalone and its dependencies (etcd and MinIO) start automatically. You can check their status by:
sudo systemctl status milvus
sudo systemctl status milvus-etcd
sudo systemctl status milvus-minio
Download Minio Client (CLI):
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo cp -ar mc /usr/bin/
Create minio buckets:
mc config host add myminio http://localhost:9000 minioadmin minioadmin;
mc rm -r --force myminio/faceapi-person;
mc rm -r --force myminio/faceapi-session;
mc mb myminio/faceapi-person;
mc mb myminio/faceapi-session;
Note
To enable Face Search on CentOS 7, make sure to change the SELinux mode to Permissive:
sudo setenforce 0
getenforce
Refer to the Install Milvus with YUM on CentOS guide.
After installation, Milvus standalone and its dependencies (etcd and MinIO) start automatically. You can check their status by:
sudo systemctl status milvus
sudo systemctl status milvus-etcd
sudo systemctl status milvus-minio
Download Minio Client (CLI):
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc
sudo cp -ar mc /usr/bin/
Create minio buckets:
mc config host add myminio http://localhost:9000 minioadmin minioadmin;
mc rm -r --force myminio/faceapi-person;
mc rm -r --force myminio/faceapi-session;
mc mb myminio/faceapi-person;
mc mb myminio/faceapi-session;
Installing PostgreSQL
Refer to the Install PostgreSQL with APT on Ubuntu guide.
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
Refer to the Install PostgreSQL with APT on Debian guide.
Configure PostgreSQL:
# Add user `postgres` to sudo group
sudo adduser postgres sudo
# Switch to `postgres` user
sudo su - postgres
# Create DB user `regula` with example password 'Regulapasswd#1'
createuser regula -d -P
# Create DB `regula_db`
createdb regula_db -O regula
Refer to the Install PostgreSQL with YUM on CentOS guide.
Configure PostgreSQL:
# Add user `postgres` to wheel group
sudo usermod -aG wheel postgres
# Switch to `postgres` user
sudo su - postgres
# Create DB user `regula` with example password 'Regulapasswd#1'
createuser regula -d -P
# Create DB `regula_db`
createdb regula_db -O regula
Configure Face Web API Service
Edit the .env
file located at /opt/regula/face-rec-service folder and add the following variables:
FACEAPI_ENABLE_IDENTIFICATION="true"
FACEAPI_SQL_HOST="localhost:5432"
FACEAPI_SQL_DB="regula_db"
FACEAPI_SQL_USER="regula"
FACEAPI_SQL_PASSWORD="Regulapasswd#1"
FACEAPI_STORAGE_ENDPOINT="http://localhost:9000"
FACEAPI_STORAGE_ACCESS_KEY="minioadmin"
FACEAPI_STORAGE_SECRET_KEY="minioadmin"
FACEAPI_STORAGE_PERSON_BUCKET_NAME="faceapi-person"
FACEAPI_STORAGE_SESSION_BUCKET_NAME="faceapi-session"
FACEAPI_MILVUS_HOST="localhost"
FACEAPI_MILVUS_PORT="19530"
Note
FACEAPI_SQL_ variables should match the values configured in Install PostgreSQL
& Install Milvus
sections.
Restart the service:
sudo systemctl restart face-rec-service
Verify Face Web API Service:
sudo systemctl status face-rec-service
Edit the .env
file located at /opt/regula/face-rec-service folder and add the following variables:
FACEAPI_ENABLE_IDENTIFICATION="true"
FACEAPI_SQL_HOST="localhost:5432"
FACEAPI_SQL_DB="regula_db"
FACEAPI_SQL_USER="regula"
FACEAPI_SQL_PASSWORD="Regulapasswd#1"
FACEAPI_STORAGE_ENDPOINT="http://localhost:9000"
FACEAPI_STORAGE_ACCESS_KEY="minioadmin"
FACEAPI_STORAGE_SECRET_KEY="minioadmin"
FACEAPI_STORAGE_PERSON_BUCKET_NAME="faceapi-person"
FACEAPI_STORAGE_SESSION_BUCKET_NAME="faceapi-session"
FACEAPI_MILVUS_HOST="localhost"
FACEAPI_MILVUS_PORT="19530"
Note
FACEAPI_SQL_ variables should match the values configured in Install PostgreSQL
& Install Milvus
sections.
Restart the service:
sudo systemctl restart face-rec-service
Verify Face Web API Service:
sudo systemctl status face-rec-service
Edit the .env
file located at /opt/regula/face-rec-service folder and add the following variables:
FACEAPI_ENABLE_IDENTIFICATION="true"
FACEAPI_SQL_HOST="localhost:5432"
FACEAPI_SQL_DB="regula_db"
FACEAPI_SQL_USER="regula"
FACEAPI_SQL_PASSWORD="Regulapasswd#1"
FACEAPI_STORAGE_ENDPOINT="http://localhost:9000"
FACEAPI_STORAGE_ACCESS_KEY="minioadmin"
FACEAPI_STORAGE_SECRET_KEY="minioadmin"
FACEAPI_STORAGE_PERSON_BUCKET_NAME="faceapi-person"
FACEAPI_STORAGE_SESSION_BUCKET_NAME="faceapi-session"
FACEAPI_MILVUS_HOST="localhost"
FACEAPI_MILVUS_PORT="19530"
Note
FACEAPI_SQL_ variables should match the values configured in Install PostgreSQL
& Install Milvus
sections.
Restart the service:
sudo systemctl restart face-rec-service
Verify Face Web API Service:
sudo systemctl status face-rec-service
Set license
To access all the capabilities of the Face Web API, you have to set a license.
To obtain the production license or other 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_x64/cpu/
sudo cp -ar ~/regula.license /opt/regula/face-rec-service/extBin/unix_x64/gpu/
2. Restart the Face Web API service:
sudo systemctl restart face-rec-service.service