This application is used as reference code for developers to show how to use the C++ API to generate a runtime key. Once a runtime key is generated it must be activated to produce a token.
The SDK is developed in C++11 and you'll need glibc 2.27+ on Linux and Microsoft Visual C++ 2015 Redistributable(x64) - 14.0.24123 (any later version is ok) on Windows. You most likely already have these dependencies on you machine as almost every program require it.
To check if all dependencies are present:
- Windows x86_64: Use Dependency Walker on binaries/windows/x86_64/FaceLivenessDetectionSDK.dll and binaries/windows/x86_64/ultimatePluginOpenVINO.dll if you're planning to use OpenVINO.
- Linux x86_64: Use
ldd <your-shared-lib>
on binaries/linux/x86_64/libFaceLivenessDetectionSDK.so and binaries/linux/x86_64/libultimatePluginOpenVINO.so if you're planning to use OpenVINO.
- On x86-64, GPGPU acceleration is disabled by default. Check here for more information on how to enable it.
If you don't want to build this sample by yourself, then use the pre-built versions:
- Windows x86_64: runtimeKey.exe under binaries/windows/x86_64
- Linux x86_64: runtimeKey under binaries/linux/x86_64. Built on Ubuntu 18. You'll need to download libtensorflow.so as explained here.
You'll need CMake to build this sample.
- Create build folder and move into it:
mkdir build && cd build
To generate the build files:
- Windows (Visual Studio files):
cmake .. -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=Release
- Linux (Makefile):
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
To build the project:
- Windows: Open the VS solution and build the projet
- Linux: Run
make
to build the project
After building the application you can test it on your local machine.
runtimeKey is a command line application with the following usage:
runtimeKey \
--assets <path-to-assets-folder> \
[--json <json-output:bool>] \
[--type <license-type:string>]
Options surrounded with [] are optional.
--assets
Path to the assets folder containing the configuration files and models. Default value is the current folder.--json
Whether to output the runtime license key as JSON string intead of raw string. Default: true.--type
Defines how the license is attached to the machine/host. Possible values are aws-instance, aws-byol, azure-instance or azure-byol. Default: null. More info here.
- On Linux x86_64 you may use the next command:
LD_LIBRARY_PATH=../../../binaries/linux/x86_64:$LD_LIBRARY_PATH ./runtimeKey \
--json true \
--assets ../../../assets
- On Windows x86_64, you may use the next command:
runtimeKey.exe ^
--json true ^
--assets ../../../assets
Please read this if you're planning to run the SDK on Amazon AWS or Microsoft Azure.