Passive Liveness Detection From Image

Declaration

func passiveLivenessDetectionFromImage(
    image: UIImage, 
    success: SybrinBiometrics.passiveLivenessDetectionSuccessCallbackType? = 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

Please ensure that the image conform to our guidelines and that only one face is visible.

Handling callback responses

success

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

Parameters:

Example:

success: { (model) in
    print("Passive liveness detection finished. You are \(model.isAlive ? "\(model.livenessConfidence * 100)% alive" : "\((1 - model.livenessConfidence) * 100)% not alive")
}

failure

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

Parameters:

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

Example:

failure: { (message) in
    print("Passive liveness detection failed because \(message)")
}

Full Example

let image = UIImage(named: "MyImage")

SybrinBiometrics.shared.passiveLivenessDetectionFromImage(image: image) 
{ (model) in
    print("Passive liveness detection finished. You are \(model.isAlive ? "\(model.livenessConfidence * 100)% alive" : "\((1 - model.livenessConfidence) * 100)% not alive")
failure: { (message) in
    print("Passive liveness detection failed because \(message)")
}

Last updated