Skip to content

Customizing face detectors

Using custom face detection logic

By default, face detection is done using the native iOS Vision framework. It is possible to add additional custom face detector logic to be used when performing the capture automatically.

vc.faceDetectorSettings.useDefaultEngines() // Optional: perform default checks first
vc.faceDetectorSettings.addCustomFaceDetectorClosure { capturedImage, completion in completion) in
    let image = idImage.uiImage
    let result = FaceDetectorResult.ok
    // Perform your own checks on the image
    // ...
    // set the result to appropriate value, e.g.:
    // result = .photoLowQuality
    completion(result)
})