To use Face SDK, install the following dependencies:
sense4.dll. This library is located in the bin folder in Face SDK. If you change the default location, It must be located next to
- Windows 64-bit:
tensorflow.dllwhen GPU/AVX2 acceleration is used. This library is located in the bin folder of Face SDK distribution package. It must be located in the directory, which the application is launched from. Otherwise, add the path to the directory with this library to the
- Windows 64-bit: Microsoft Visual C++ Redistributable for Visual Studio 2019
- Linux 64-bit:
libtensorflow.so.2when GPU/AVX2 acceleration is used. This library is located in the lib folder in Face SDK.
libfacerec library is loaded dynamically in runtime mode when the static method
pbio::FacerecService::createService is called. Therefore, do not link your program with
libfacerec.so (Linux) or
facerec.dll (Windows). Only add the include directory to include directories, or, for Linux projects, to link the
libdl library with the
Warning: You can call
pbio::FacerecService::createService only once, otherwise, you may encounter a crash.
All libfacerec declarations are divided in two headers:
- facerec/import.h – must be included only once (for example, in `main.cpp`).
- facerec/libfacerec.h – must be included in each file that uses a library.
The libfacerec library doesn't have any actual third-party dependencies*, since all used third-party libraries (see Open Source Licenses) are linked statically. Therefore, any version of these libraries must work for examples, in which OpenCV or boost is used.
* – except for the linux x86_64 and windows_x86_64 distribution packages when GPU/AVX2 acceleration is used - in this case, a dependency on
tensorflow.dll is used.
You can get the current library version by calling the
get_version method from the created
FacerecService object. This method will return a string in the format of
x is the major version,
yy is the minor version, and
zz is the patch version.
In C++ the version can be additionally obtained from the preprocessor constants:
LIBFACEREC_VERSION– string representation, similar to
LIBFACEREC_VERSION_HEX– 3-byte HEX representation that is useful in numeric comparisons, e.g.
facerec.jar in a project, specify the path to this file in
facerec.jar Java library is a wrapper for the C++ library, so
libfacerec.so for Linux and Android or
facerec.dll for Windows are required in runtime. Path to the directory, which contains
facerec_jni.dll, must be specified in
To use facerec in a project, add a reference to
FacerecCSharpWrapper.dll in a project. Add
facerec.so (for Linux) or
facerec.dll (for Windows) and
FacerecCSharpWrapper.dll to the folder with executable file.
To use the libfacerec library, call the
FacerecService.createService method, which dynamically loads the library.
FacerecService.createService method has an overloading signature and can be called:
- by passing the path to the directory with the license
- by passing the license in the form of a special structure:
Warning: You can call
FacerecService.createService only once, otherwise, you may encounter a crash.