Trueface SDK Reference - Beta

Welcome to the Trueface SDK. The SDK allows you to integrate Trueface’s AI models directly into your application while ensuring maximum performance and flexibility. Start by downloading the correct version of the SDK for your target platform and desired language. Next, refer to the General section for guidance on how to initialize the SDK.

Downloads

Beta release version 3.0.30900

Choosing Your Release Type

Alpha contains the absolute latest features (updated daily), but may also contain bugs. Beta contains fewer bugs while still having relatively new features. Stable will contain the fewest bugs but will take the longest to get new features. You will generally want to choose the Beta or Stable releases.

Note, if downloading the SDK in an automated manner (ex. building docker images) and you always require the latest SDK version, then replace the postfix in the download link (SDK version) with _latest.zip instead. So for example, https://reference.trueface.ai/cpp/staging/latest/uploads/truefaceSDK_v0.10.5483.zip would become https://reference.trueface.ai/cpp/staging/latest/uploads/truefaceSDK_latest.zip. This is only available for Alpha and Beta releases.

If you require a previous version of the documentation or SDK downloads, refer to the Previous Stable Releases tab on the left.

x86-64 C++

Target platform

Notes

SHA256

C++ x86-64 CPU Linux, Ubuntu 20.04

Compiled with gcc 9.3.0, GLIBC 2.31, tested on Ubuntu 20.04.

73ebf8e16a...

C++ x86-64 CPU Linux, Ubuntu 22.04

Compiled with gcc 11.4.0, GLIBC 2.35, tested on Ubuntu 22.04.

73ebf8e16a...

C++ x86-64 GPU cuda-11.8 Linux, Ubuntu 20.04

Must install GPU dependencies. Compiled with gcc 9.3.0, GLIBC 2.31, Cuda 11.8, tested on Ubuntu 20.04.

7f2870a599...

C++ x86-64 GPU cuda-12.0 Linux, Ubuntu 22.04

Must install GPU dependencies. Compiled with gcc 11.4.0, GLIBC 2.35, Cuda 12.0, tested on Ubuntu 22.04.

96d139190f...

C++ x86-64 CPU Windows

Must install Windows dependencies. Compiled with MSVC 19.35.32217.1 in Release mode.

ac0b1ca0dd...

x86-64 Python bindings

Python bindings Documentation
Python bindings documentation can be found here

Target platform

Notes

SHA256

Python 3.8 CPU Linux

For CentOS, must run dnf install -y libgomp. Tested on Ubuntu 20.04.

db3e271b50f04221b9f250c6b511dd270650a82166597099eba82cefb31d14d1...

Python 3.9 CPU Linux

For CentOS, must run dnf install -y libgomp. Tested on Ubuntu 20.04.

9efc9b3236bd70096ec38911860728523dfc95bf191cd14772120ceb34c1c56f...

Python 3.10 CPU Linux

For CentOS, must run dnf install -y libgomp. Tested on Ubuntu 20.04.

217bb5de584425714964ccef4875a7f6b9788dde8debbfe98e0d5b620ae6b99f...

Python 3.11 CPU Linux

For CentOS, must run dnf install -y libgomp. Tested on Ubuntu 20.04.

4e1a40087d1ec2547d34b6d673b9071559079c6a9efb1580a4f4fa88e6ef2187...

Python 3.12 CPU Linux

For CentOS, must run dnf install -y libgomp. Tested on Ubuntu 20.04.

fb4a1b0504e8a1306b51b72f659c0fb646589856945dba1e979f312d8b09832d...

Python 3.8 GPU cuda-11.8 Linux, Ubuntu 20.04

Must install GPU dependencies. Tested on Ubuntu 20.04.

f0923756a4cffdce0171ddc80fc40c51609e562015695f19cefd6414e7836a79...

Python 3.9 GPU cuda-11.8 Linux, Ubuntu 20.04

Must install GPU dependencies. Tested on Ubuntu 20.04.

07d4218fee4033550cb3926003579b73d506ac89a1396940c0d639ff3701d8eb...

Python 3.10 GPU cuda-11.8 Linux, Ubuntu 20.04

Must install GPU dependencies. Tested on Ubuntu 20.04.

82cdd22fed52cd3b7d0ea6b1de42e1bcb9f5a45cd461944807aa645fa0de0623...

Python 3.11 GPU cuda-11.8 Linux, Ubuntu 20.04

Must install GPU dependencies. Tested on Ubuntu 20.04.

10a82f10fee1d8374b910cdf1178f54d6d9efaefdb41bc216d0bfb432ebf6ebf...

Python 3.12 GPU cuda-11.8 Linux, Ubuntu 20.04

Must install GPU dependencies. Tested on Ubuntu 20.04.

768cb7b27408369936188fa3f915d806b20f32d47f964754de922fa909d646fa...

Python 3.8 GPU cuda-12.0 Linux, Ubuntu 22.04

Must install GPU dependencies. Tested on Ubuntu 22.04.

4a8a7dac80364def7999f2af725b959c5d69449a3260c4947d03c3e6fff533f4...

Python 3.9 GPU cuda-12.0 Linux, Ubuntu 22.04

Must install GPU dependencies. Tested on Ubuntu 22.04.

4b4e91a8c0873cc5aa7429e599a564f9a78434890253c293027da2ed9df349ac...

Python 3.10 GPU cuda-12.0 Linux, Ubuntu 22.04

Must install GPU dependencies. Tested on Ubuntu 22.04.

da8ee55dc36bbd4100383f8660ca1e4cf55c24b0dff61071dba422221924a6a9...

Python 3.11 GPU cuda-12.0 Linux, Ubuntu 22.04

Must install GPU dependencies. Tested on Ubuntu 22.04.

a4b2e6aaca990e3afa6ddd678d8c73d1e3daba60e1e7dcc34d7404f429f6ed66...

Python 3.12 GPU cuda-12.0 Linux, Ubuntu 22.04

Must install GPU dependencies. Tested on Ubuntu 22.04.

2f71b1f2254618d4e513b9480235555cd8e5a1a04d5d469caad76021c6cc94fa...

ARM C++

Target platform

Notes

SHA256

Aarch64 CPU Ubuntu 20.04

Compiled with aarch64-linux-gnu-g++ 9.4.0, GLIBC 2.31, tested on Ubuntu 20.04.

24f6dc1784...

Aarch64 CPU Ubuntu 22.04

Compiled with aarch64-linux-gnu-g++ 11.4.0, GLIBC 2.35, tested on Ubuntu 22.04.

e26f6a5b78...

Aarch64 GPU CUDA-12.0 Linux, Ubuntu 22.04

Must install GPU dependencies. Compiled with aarch64-linux-gnu-g++ 11.4.0, GLIBC 2.35, CUDA-12.0, tested on Ubuntu 22.04.

b7a392116c...

ARM Python Bindings

Python bindings Documentation
Python bindings documentation can be found here

Target platform

Notes

SHA256

Python 3.8 CPU Ubuntu 20.04 Aarch64

Tested on Ubuntu 20.04.

15da11f910126c9d47b95b8425baa314120e426069abcf1e818ba69815cb2734...

Python 3.9 CPU Ubuntu 20.04 Aarch64

Tested on Ubuntu 20.04.

2b2968cc8594ca9ef2072d73330af6b869b35c86dec9190f0382182a8e42a2fb...

Python 3.10 CPU Ubuntu 20.04 Aarch64

Tested on Ubuntu 20.04.

ccd357b634ed6d218d207bb0961da281ca5c26de5deb1240e28d9d0b1bd0e8ca...

Python 3.11 CPU Ubuntu 20.04 Aarch64

Tested on Ubuntu 20.04.

f649a45755db87c8f6fc2cfb1ee99da00793833eba7d936a71c1ce1c39714bf7...

Python 3.12 CPU Ubuntu 20.04 Aarch64

Tested on Ubuntu 20.04.

42e596de26846b915f96649e55a344c3710b9ab6215c35da16773309cd9dcf80...

Python 3.8 CPU Ubuntu 22.04 Aarch64

Tested on Ubuntu 22.04.

5cac496620981b45b74c4c203834b8592c8122e19efd34aee7fcbc566cd9bf2e...

Python 3.9 CPU Ubuntu 22.04 Aarch64

Tested on Ubuntu 22.04.

3ab50fe26e9e2704a5bdffc4eab604d0455501aa31025ce4985512c485f9e853...

Python 3.10 CPU Ubuntu 22.04 Aarch64

Tested on Ubuntu 22.04.

82c87d89fd13abf09605aaca6705cf6eb12b3123125a1e24d9bdd68bcd888a9a...

Python 3.11 CPU Ubuntu 22.04 Aarch64

Tested on Ubuntu 22.04.

e3156603e96972febc9e8729e96ea7a7cc3332006bcfad93f3b42b5d42ef8b6a...

Python 3.12 CPU Ubuntu 22.04 Aarch64

Tested on Ubuntu 22.04.

2f64d01e648ea9a99bfc42c17fd1ea6ee656b3990c09b7f74a0bfbe6098206cf...

Python 3.8 GPU CUDA-12.0 Ubuntu 22.04 Aarch64

Must install GPU dependencies. Tested on Ubuntu 22.04.

a66a11df9b377356b1d060b4e62d1025f7ff0e918478be966ee8c95fe0901fdf...

Python 3.9 GPU CUDA-12.0 Ubuntu 22.04 Aarch64

Must install GPU dependencies. Tested on Ubuntu 22.04.

8b631bedbe7439928067e01321a56ba65a1b120d97d5ab25f158fdabb7d0f0bf...

Python 3.10 GPU CUDA-12.0 Ubuntu 22.04 Aarch64

Must install GPU dependencies. Tested on Ubuntu 22.04.

4314ef5d4d4ca4c934793edab27b6f6612a55f11c632ef4522790e7bad31825a...

Python 3.11 GPU CUDA-12.0 Ubuntu 22.04 Aarch64

Must install GPU dependencies. Tested on Ubuntu 22.04.

ed9ae61f4a70c8d94e5bba75748258d8dbb8409f8b1aa8281baf6d81e5669a60...

Python 3.12 GPU CUDA-12.0 Ubuntu 22.04 Aarch64

Must install GPU dependencies. Tested on Ubuntu 22.04.

66b671f85d9376d7437bedd8de1507ecbfa111fe0a60a7ae886ab24639ccce8c...

iOS

iOS SDK Documentation
iOS SDK documentation can be found here

Target platform

iOS

Android

Android SDK Documentation
Android SDK documentation can be found here

Target platform

Android

NodeJS

The NodeJS SDK can be downloaded from npm by running npm install @trueface/trueface-sdk-javascript or by visiting this link.
The NodeJS documentation can be found here.

SDK Dependencies

The SDK has a few external dependencies, including:

  • OpenMP

  • libdl

  • ONNX Runtime

When linking against the static Trueface SDK, these dependencies must be manually linked by specifying them in the target_link_libraries command in the CMakeLists.txt file. When linking against the dynamic Trueface SDK, they do not need to be manually linked as the dependency linkage has already been set to Public.

Before you can run an application linking against the SDK, you will need to add the directory which contains the onnxruntime shared library (shipped as part of the SDK bundle) to you LD_LIBRARY_PATH environment variable.

GPU SDK Dependencies

In addition to the dependencies listed above, the GPU SDK has a few additional dependencies which must be installed.

Ubuntu 20.04 and 22.04

  1. Start by installing the NVIDIA drivers on your machine by following the instructions here.

  2. Next, you will need to install CUDA:

    Ubuntu 20.04:

    Instructions for 11.8

    Ubuntu 22.04:

    Instructions for 12.0

  3. After installing CUDA, the CUDA Deep Neural Network (cuDNN) libraries need to be installed. The SDK requires cuDNN 8, the instructions for which can be found here. NOTE: the cuDNN 8 version MUST match the installed version of CUDA. For example:

    Ubuntu 20.04:

    libcudnn8=8.6.1.6+cuda11.8

    Ubuntu 22.04:

    libcudnn8=8.6.1.6+cuda12.0

  4. Next, navigate to this link, create an account or login with your existing account, then click on TensorRT 8.6 GA. From there download the appropriate version of the TensorRT 8.6 GA for x86_64 Architecture. Once downloaded, extract the package by running tar -xzf ./TensorRT-8.6.1.6.Linux.x86_64-gnu.cuda-11.8.tar.gz then add the full path to the TensorRT-8.6.1.6/lib directory to your LD_LIBRARY_PATH environment variable (ex. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/tensorrt/dir/lib. If you want this change to persist, you should add the command to your ~/.bashrc.).

  5. Finally, run the following commands:

    apt-get install -y libomp-dev libopenblas-dev libgomp1
    ln -s /usr/lib/x86_64-linux-gnu/libomp.so.5 /usr/lib/x86_64-linux-gnu/libomp.so
    

Alternatively, you can use either the nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04 or nvidia/cuda:12.0.0-cudnn8-runtime-ubuntu22.04 docker images, but you will need still need to complete steps 4 and 5 above.

AArch64 CUDA 10.2 - Ubuntu 18.04
The NVIDIA Jetson OS comes with the required version of CUDA, cudnn, and TensorRT pre-installed. Therefore, only the following commands must be run:
apt-get install -y libopenblas-dev

If you see that your system has libnvinfer.so.7 installed instead of the required libnvinfer.so.8, then you’ll need to update the image running on your Jetson.

Windows SDK

For a full tutorial on how to install the Windows SDK, please consult this video.

Our team does the majority of development and testing in a Unix environment. The Windows SDK may therefore contain more bugs than the other platform releases and may be lacking in a few features. The current known issues and limitations are as follows:

  • Any file including winerror.h must have #undef NO_ERROR as the NO_ERROR defined in winerror.h conflicts with Trueface::ErrorCodes::NO_ERROR.

  • Trueface::SDK::identifyTopCandidate() and Trueface::SDK::identifyTopCandidates() will only use a single thread for search and will therefore be slower than searches run on Unix platforms. However, Trueface::SDK::batchIdentifyTopCandidate() is capable of using multiple threads.

Dependencies which must be installed. These dependencies will automatically be installed by installing Git for Windows:

  • libintl-8.dll

  • libcrypto-1_1-x64.dll

  • libsll-1_1-x64.dll

As of this time, we are only supporting a release configured version of the library (and not a debug version). The library is built as a dynamic library; therefore, you must link against libtf.lib when compiling your application and must ensure that libtf.dll is in the same directory as your executable.

We advise using “Git Bash” when compiling and and running your application to ensure the dependency libraries are properly found.

Getting Started Tutorials

Every SDK download package comes bundled with sample code (C++ and Python) demonstrating proper usage of the SDK for various tasks such as face detection, face recognition, object detection, mask detection, and more. Start by understanding how the sample code works by reading the comments in the code.

Sample Apps

Sample Apps demonstrate full working applications. These extend the scope of the sample code which comes shipped with the SDK.

Reporting SDK Bugs and Documentation Errors

If you encounter a bug in the SDK, please send an email to support@pangiam.com. Please include at minimum the following:

  • SDK version

  • SDK target (ex. Python 3.7 CPU Linux)

  • Expected behaviour

  • Observed behaviour

  • A minimal reproducible code example showing how to replicate the bug

  • Any input images used

The more information you provide, the faster we can diagnose the issue and push out a fix.

If you happen to find a mistake (spelling, syntax error, etc.) in the latest Alpha, Beta, or Stable documentation, please email support@pangiam.com with a screenshot of the mistake, documentation version number (same as SDK version), and the release type (Alpha, Beta, or Stable). We will push out a fix as soon as we can.