Core facility#
LivenessEngine object#
The LivenessEngine object is a root object of the entire LivenessEngine. Everything begins with it, so it is essential to create at least one instance of it. Although it is possible to have multiple instances of the LivenessEngine, it is impractical to do so. Call createLivenessEngine() function to create a LivenessEngine instance . Also, you may specify default dataPath in createLivenessEngine() parameters.
The LivenessEngine requires Face Engine instance as well for internal sub-module initialization. If no Face Engine is provided, a new one is created implicitly.
Data paths#
Various LivenessEngine modules may require data files to operate. These files contain various constants used at runtime. The data directory location is assumed to reside in:
- /opt/visionlabs/data for the Linux CentOS delivery package;
- ./data for the Windows delivery package.
One may override the data directory location using setDataDirectory() method which is available in ILivenessEngine. Current data location may be retrieved via getDataDirectory() method
Configuration file#
For proper functioning LivenessEngine requires the configuration file. The file is called livenessengine.conf and stored in dataPath directory by default.
It contains configuration parameters which are required for every liveness scenario included in the library (face tracking configuration, each test scenario duration, various thresholds and so forth). More details on configuration file contents are in Appendix A.
At runtime, the configuration file data is managed by a special object that implements ISettingsProvider interface. The provider is instantiated using createSettingsProvider() function that accepts configuration file location as a parameter or uses a default one if not explicitly defined.
One may supply a different configuration to any factory object using setSettingsProvider() method which is available in each factory object interface, including ILivenessEngine. Currently, bound settings provider can be retrieved via getSettingsProvider() method.