Load Model

Declaration

func loadModel(
    for identifier: String, 
    success: SybrinBiometrics.loadModelSuccessCallbackType? = nil, 
    failure: SybrinBiometrics.failureCallbackType? = nil
)

To view all the type aliases, go to the SybrinBiometrics class

Handling the success or failure callbacks are optional but recommended.

Calling the function

Parameters

Type

Description

String

The identifier you would like to load the model for.

Sybrin does not provide user management for the identifiers you train and recognize on your license key. The proper management and storage of unique identifiers is the sole responsibility of you as the developer.

Handling callback responses

success

The success callback will be executed after the session has finished and the view controller has been dismissed.

Parameters:

Type

Description

An object containing the results of the model that was loaded.

Example:

success: { (model) in
    print("Load model finished. Loaded model for \(model.identifier), it took \(model.timeTakenMilliseconds) milliseconds\(model.modelDownloaded ? " to download" : "")")
}

failure

The failure callback will be executed after the session has failed and the view controller has been dismissed.

Parameters:

Type

Description

String

A message describing the error.

If you would like to report a bug, contact us!

Example:

failure: { (message) in
    print("Load model failed because \(message)")
}

Full Example

let identifier = "uniqueIdentifier"

SybrinBiometrics.shared.loadModel(for: identifier) { (model) in
    print("Load model finished. Loaded model for \(model.identifier), it took \(model.timeTakenMilliseconds) milliseconds\(model.modelDownloaded ? " to download" : "")")
} failure: { (message) in
    print("Load model failed because \(message)")
}

Last updated