.. TruefaceSDK documentation master file, created by sphinx-quickstart on Mon Sep 16 22:16:39 2019. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Trueface SDK Reference - Stable ============================================== 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 ######### Stable release version ``SDK_VERSION`` 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. - `Alpha `_ - `Beta `_ - `Stable `_ 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``. 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++ ********** .. list-table:: :header-rows: 1 * - Target platform - SHA256 - Notes * - `C++ x86-64 CPU Linux, Ubuntu 18.04 and CentOS 8 `_ - ``SHA256_x86_cpu_linux_cpp...`` - Compiled with gcc 7.5.0, GLIBC 2.27, tested on Ubuntu 18.04 and CentOS 8. * - `C++ x86-64 CPU Linux, Ubuntu 20.04 `_ - ``SHA256_x86_cpu_ubuntu20_cpp...`` - Compiled with gcc 9.3.0, GLIBC 2.31, tested on Ubuntu 20.04. * - `C++ x86-64 GPU CUDA-10.1 Linux, Ubuntu 18.04 and CentOS 8 `_ - ``SHA256_x86_gpu_linux_cpp...`` - Compiled with gcc 7.5.0, GLIBC 2.27, Cuda 10.1, tested on Ubuntu 18.04 and CentOS 8. Must install GPU `dependencies `_. * - `C++ x86-64 GPU CUDA-11.2 Linux, Ubuntu 18.04 and CentOS 8 `_ - ``SHA256_x86_gpu_cuda11_ubuntu18_04_linux_cpp...`` - Compiled with gcc 7.5.0, GLIBC 2.27, Cuda 10.1, tested on Ubuntu 18.04 and CentOS 8. Must install GPU `dependencies `_. * - `C++ x86-64 GPU CUDA-11.2 Linux, Ubuntu 20.04 `_ - ``SHA256_x86_gpu_cuda11_linux_cpp...`` - Compiled with gcc 9.3.0, GLIBC 2.31, Cuda 11.2, tested on Ubuntu 20.04. Must install GPU `dependencies `_. * - `C++ x86-64 CPU macOS `_ - ``SHA256_x86_cpu_macos_cpp...`` - Compiled with AppleClang 11. * - `C++ x86-64 CPU Windows `_ - ``SHA256_x86_cpu_windows_cpp...`` - Compiled with MSVC 19.28.29913.0 in Release mode. `More info `_. x86-64 Python bindings ********************** | **Python bindings Documentation** | Python bindings documentation can be found `here `_ .. list-table:: :header-rows: 1 * - Target platform - SHA256 - Notes * - `Python 3.6 64Bit CPU Linux `_ - ``SHA256_x86_cpu_linux_python3_6...`` - Tested on Ubuntu 18.04, Ubuntu 20.04, and CentOS 8. For CentOS, must run ``dnf install -y libgomp``. * - `Python 3.6 64Bit GPU CUDA-10.1 Linux `_ - ``SHA256_x86_gpu_linux_python3_6...`` - Tested on Ubuntu 18.04, Ubuntu 20.04, and CentOS 8. Must install GPU `dependencies `_. * - `Python 3.7 64Bit CPU Linux `_ - ``SHA256_x86_cpu_linux_python3_7...`` - Tested on Ubuntu 18.04, Ubuntu 20.04, and CentOS 8. For CentOS, must run ``dnf install -y libgomp``. * - `Python 3.7 64Bit CPU macOS `_ - ``SHA256_x86_cpu_macos_python3_7...`` - * - `Python 3.7 64Bit GPU CUDA-10.1 Linux `_ - ``SHA256_x86_gpu_linux_python3_7...`` - Tested on Ubuntu 18.04, Ubuntu 20.04, and CentOS 8. Must install GPU `dependencies `_. * - `Python 3.8 64Bit CPU Linux `_ - ``SHA256_x86_cpu_linux_python3_8...`` - Tested on Ubuntu 18.04, Ubuntu 20.04, and CentOS 8. For CentOS, must run ``dnf install -y libgomp``. * - `Python 3.8 64Bit CPU macOS `_ - ``SHA256_x86_cpu_macos_python3_8...`` - * - `Python 3.8 64Bit GPU CUDA-10.1 Linux `_ - ``SHA256_x86_gpu_linux_python3_8...`` - Tested on Ubuntu 18.04, Ubuntu 20.04, and CentOS 8. Must install GPU `dependencies `_. * - `Python 3.8 64Bit GPU CUDA-11.2 Linux `_ - ``SHA256_x86_gpu_cuda11_linux_python3_8...`` - Tested on Ubuntu 20.04. Must install GPU `dependencies `_. ARM C++ ******* .. list-table:: :header-rows: 1 * - Target platform - SHA256 - Notes * - `Aarch64 CPU Linux `_ - ``SHA256_aarch64_cpu_linux...`` - Compiled with aarch64-linux-gnu-g++ 7.5.0, GLIBC 2.27, tested on Ubuntu 18.04. * - `Aarch64 GPU CUDA-10.2 Linux, Ubuntu 18.04 `_ - ``SHA256_aarch64_cuda_linux...`` - Compiled with aarch64-linux-gnu-g++ 7.5.0, GLIBC 2.27, CUDA-10.2, tested on Ubuntu 18.04. Must install GPU `dependencies `_ * - `Aarch32 CPU Linux `_ - ``SHA256_arm32_cpu_linux...`` - Compiled with arm-linux-gnueabihf-g++ 7.5.0, GLIBC 2.27, tested on Ubuntu 18.04. ARM Python Bindings ******************* | **Python bindings Documentation** | Python bindings documentation can be found `here `_ .. list-table:: :header-rows: 1 * - Target platform - SHA256 - Notes * - `Python 3.6 64Bit CPU Linux Aarch64 `_ - ``SHA256_python36_aarch64...`` - Tested on Ubuntu 18.04. * - `Python 3.6 64Bit GPU CUDA-10.2 Linux Aarch64 `_ - ``SHA256_aarch64_cuda_linux...`` - Tested on Ubuntu 18.04. Must install GPU `dependencies `_. * - `Python 3.6 32Bit CPU Linux Aarch32 `_ - ``SHA256_python36_arm32...`` - Tested on Ubuntu 18.04. * - `Python 3.7 64Bit CPU Linux Aarch64 `_ - ``SHA256_python37_aarch64...`` - Tested on Ubuntu 18.04. * - `Python 3.7 32Bit CPU Linux Aarch32 `__ - ``SHA256_python37_arm32...`` - Tested on Ubuntu 18.04. iOS *** | **iOS SDK Documentation** | iOS SDK documentation can be found `here `_ .. list-table:: :header-rows: 1 * - Target platform - SHA256 - Notes * - `iOS `_ - ``SHA256_ios...`` - Package contains both ARM64 and X86_64 SDK. Android ******* .. list-table:: :header-rows: 1 * - Target platform - SHA256 * - `Android `_ - N/A GPU SDK Dependencies ==================== While the CPU SDK is dependency free (only requires OpenMP for Linux and Windows), the GPU SDK does have a few dependencies which must be installed. As of right now, the CUDA 10.1 SDK supports Ubuntu and CentOS, while the CUDA 11.2 SDK only supports Ubuntu (this is due to GLIBC versions). We will assume you already have the nvidia drivers installed on your machine. | **CUDA 10.1 - Ubuntu** | You will need to install CUDA 10.1, cudnn7, libomp, libgomp, and libopenblas. | All the necessary runtime dependencies can be installed on Ubuntu 18.04 by running the following commands: .. code-block:: bash apt-get install -y libomp-dev libopenblas-dev software-properties-common libgomp1 add-apt-repository ppa:graphics-drivers apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list' bash -c 'echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda_learn.list' apt update apt install cuda-10-1 apt install libcudnn7 export PATH=/usr/local/cuda-10.1/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} If using docker, we advise using the ``nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04`` docker image. If using Ubuntu 20.04 (for python bindings library), then you may have to run ``sudo ln -s /usr/lib/x86_64-linux-gnu/libomp.so.5 /usr/lib/x86_64-linux-gnu/libomp.so``. | **CUDA 10.1 - CentOS** | Starting from the ``nvidia/cuda:10.1-cudnn7-runtime-centos8`` docker image, run the following commands: .. code-block:: bash dnf --enablerepo=powertools install -y openblas-devel dnf install -y libgomp libomp | **CUDA 11.2 - Ubuntu 18.04** | Starting from the ``nvidia/cuda:11.2.0-cudnn8-runtime-ubuntu18.04`` docker image, run the following commands: .. code-block:: bash apt-get install -y libomp-dev libopenblas-dev libgomp1 | **CUDA 11.2 - Ubuntu 20.04** | Starting from the ``nvidia/cuda:11.2.0-cudnn8-runtime-ubuntu20.04`` docker image, run the following commands: .. code-block:: bash 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 | **AArch64 CUDA 10.2 - Ubuntu 18.04** | The NVIDIA Jetson OS comes with the required version of CUDA and cudnn pre-installed. Therefore, only the following commands must be run: .. code-block:: bash apt-get install -y libomp-dev libopenblas-dev libgomp1 Windows SDK =========== Our team does the majority of development and testing in a Linux 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``. - TFV5 inference is slower than FULL model inference and is under investigation. - :meth:`Trueface::SDK::identifyTopCandidate` and :meth:`Trueface::SDK::identifyTopCandidates` will only use a single thread for search and will therefore be slower than searches run on Unix platforms. However, :meth:`Trueface::SDK::batchIdentifyTopCandidate` is capable of using multiple threads. Dependencies which must be installed. They can easily 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. Getting Started Tutorials ========================= Every SDK download package comes bundled with sample code 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@trueface.ai. Please include at minimum the following: - SDK version - SDK target (ex. Python 3.7 64Bit 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@trueface.ai 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. .. toctree:: :maxdepth: 2 :caption: C++ (Stable) - Contents: usage/general usage/license usage/image usage/face_detection usage/face_recognition usage/identification usage/object usage/spoof usage/pose usage/liveness usage/mask usage/eyeglasses usage/environment usage/faq usage/changelog ./releases.rst * :ref:`genindex`