Enrollment 28.2.0
Loading...
Searching...
No Matches
Manual initialisation

By default, the Enrollment SDK initializes itself automatically when the shared library is loaded. More...

Classes

struct  InitializerConfig
 SDK initialisation configuration for manual init. More...
class  InitializerConfigBuilder
 Fluent builder for InitializerConfig. More...

Functions

static std::string FindLicenseFile ()
 Finds the installed license file using the same search order as auto-init.
static std::string DefaultModelsDirectory ()
 Returns the default IFace models directory.
static void Initialize (const InitializerConfig &config)
 Initialize SDK from InitializerConfig (license, models path, and thread counts).
static void Initialize (std::vector< uint8_t > license, std::string modelsPath)
 Initialize SDK.

Detailed Description

By default, the Enrollment SDK initializes itself automatically when the shared library is loaded.

If you need to control OpenCV or ONNX Runtime thread counts before the SDK loads its models, suppress auto-init and explicitly initialize the SDK with a custom configuration. Automatic initialization may not be suitable when some prerequisites are unavailable at startup or when full control over the SDK configuration is required. In such cases, initialize the SDK explicitly using either Initialize(std::vector<uint8_t> license, std::string modelsPath) or Initialize(const InitializerConfig& config). The initialization functions can only be called once during the lifetime of the process. The Enrollment SDK also provides the helper functions DefaultModelsDirectory() and FindLicenseFile(), which can be used to populate the default paths in the initialization configuration.

For Java-specific initialization requirements (loading native libraries before any SDK call), see the initialization section of the Java binding documentation.

  • c++
    const auto cfg = inno::InitializerConfigBuilder()
    .SetLicensePath(inno::FindLicenseFile())
    .SetModelsPath(inno::DefaultModelsDirectory())
    .SetFaceIrisOpencvThreads(4)
    .SetFaceIrisOrtIntraThreads(4)
    .SetFaceIrisOrtInterThreads(1)
    .Build();
    inno::Initialize(cfg);
    // SDK is now fully initialised with the requested thread counts.
    // Proceed with normal face / iris / fingerprint operations.
  • java
    EnrollmentInitializer.LoadNativeLibrary(
    ()
    -> new InitializerConfigBuilder()
    .SetLicensePath(enrollment.FindLicenseFile())
    .SetModelsPath(
    enrollment.DefaultModelsDirectory())
    .SetFaceIrisOpencvThreads(4)
    .SetFaceIrisOrtIntraThreads(4)
    .SetFaceIrisOrtInterThreads(1)
    .Build());
    // SDK is now fully initialized with the requested thread counts.
    // Proceed with normal face / iris / fingerprint operations.
  • csharp
    using (var builder = new InitializerConfigBuilder())
    {
    var cfg = builder
    .SetLicensePath(enrollment.FindLicenseFile())
    .SetModelsPath(enrollment.DefaultModelsDirectory())
    .SetFaceIrisOpencvThreads(4)
    .SetFaceIrisOrtIntraThreads(4)
    .SetFaceIrisOrtInterThreads(1)
    .Build();
    enrollment.Initialize(cfg);
    }
    // SDK is now fully initialised with the requested thread counts.
    // Proceed with normal face / iris / fingerprint operations.

Function Documentation

◆ DefaultModelsDirectory()

std::string DefaultModelsDirectory ( )
inlinestatic

Returns the default IFace models directory.

The path is iface/models next to the loaded Enrollment SDK library (the directory containing libinnoenrollment.so or innoenrollment.dll). The directory is not guaranteed to exist on disk; this function does not verify the path.

Returns
path to the default models directory For package layout and auto-initialization, see Initialization and Solvers.

◆ FindLicenseFile()

std::string FindLicenseFile ( )
inlinestatic

Finds the installed license file using the same search order as auto-init.

Search order:

  1. Current working directory (iengine.lic)
  2. User home directory (~/.innovatrics/iengine.lic on Linux/macOS, LOCALAPPDATA%\Innovatrics\iengine.lic on Windows)
  3. System directory (/etc/innovatrics/iengine.lic on Linux/macOS, C:\ProgramData\Innovatrics\iengine.lic on Windows)
Returns
path to the license file, or empty string if not found
Note
The result is cached after the first call. Ensure the license file is present before calling this function for the first time.

◆ Initialize() [1/2]

void Initialize ( const InitializerConfig & config)
inlinestatic

Initialize SDK from InitializerConfig (license, models path, and thread counts).

Use this overload when you need to control thread counts before the SDK loads its models (e.g. on multi-core Android devices to reduce iris extraction latency). Set INNO_ENROLLMENT_SDK_MANUAL_INITIALIZATION=1 before loading the library to suppress auto-init and preserve the parameter window for this call. Accepted values are case-insensitive: 1, true, on, manual, enable, enabled.

Parameters
configinitialisation configuration built with InitializerConfigBuilder
Exceptions
EnrollmentInvalidArgumentExceptionwhen config has empty or missing license data
EnrollmentExceptionwhen Enrollment SDK is already initialized

Referenced by Initialize().

Here is the caller graph for this function:

◆ Initialize() [2/2]

void Initialize ( std::vector< uint8_t > license,
std::string modelsPath )
inlinestatic

Initialize SDK.

SDK is initialized automatically when library is called. It uses models delivered side by side with library. The licence is used from known paths. When SDK is used on system like Android, that do not allow to access files, user can use this function to initialize library.

Parameters
licenselicense content
modelsPathpath to provided solvers
Exceptions
EnrollmentExceptionwhen Enrollment SDK is already initialized

References InitializerConfigBuilder::Build(), Initialize(), InitializerConfigBuilder::SetLicenseContent(), InitializerConfigBuilder::SetModelsPath(), and InitializerConfigBuilder::UseSingleCore().

Here is the call graph for this function: