DOT iOS Face Lite 6.0.0

This guide describes how to migrate DOT iOS Face Lite version 5.x to version 6.0.0. Only the most important changes are highlighted in this guide. For more details, see the iOS sample.

Migration Steps

FaceAutoCaptureViewController component

  • Class FaceAutoCaptureConfiguration.QualityAttributeThresholds is using Builder pattern.
  • Added FaceAutoCaptureConfiguration.QualityAttributeThresholdPresets.standard preset.
  • It is possible to create new FaceAutoCaptureConfiguration.QualityAttributeThresholds, use one of the presets from FaceAutoCaptureConfiguration.QualityAttributeThresholdPresets as is, or modify one of the presets from FaceAutoCaptureConfiguration.QualityAttributeThresholdPresets.

Before

// Create new thresholds
let qualityAttributeThresholds = try FaceAutoCaptureConfiguration.QualityAttributeThresholds(minConfidence: 0.12, sizeInterval: try .init(min: 0.7, max: 0.75))
let configuration = FaceAutoCaptureConfiguration(qualityAttributeThresholds: qualityAttributeThresholds)

// Use presets
-
// Modify presets
-

After

// Create new thresholds
let qualityAttributeThresholdsBuilder = FaceAutoCaptureConfiguration.QualityAttributeThresholds.Builder()
try qualityAttributeThresholdsBuilder.minConfidence(.init(value: 0.2))
let qualityAttributeThresholds = qualityAttributeThresholdsBuilder.build()
let configuration = FaceAutoCaptureConfiguration(qualityAttributeThresholds: qualityAttributeThresholds)

// Use presets
let qualityAttributeThresholds = FaceAutoCaptureConfiguration.QualityAttributeThresholdPresets.standard.build()
let configuration = FaceAutoCaptureConfiguration(qualityAttributeThresholds: qualityAttributeThresholds)

// Modify presets
let qualityAttributeThresholdsBuilder = FaceAutoCaptureConfiguration.QualityAttributeThresholdPresets.standard
try qualityAttributeThresholdsBuilder
	.minConfidence(.init(value: 0.3)) // modify confidence validation threshold
	.sizeInterval(nil) // remove size validation thresholds
	.sizeInterval(.init(min: 0.16, max: 0.2)) // add size validation thresholds
let qualityAttributeThresholds = qualityAttributeThresholdsBuilder.build()
let configuration = FaceAutoCaptureConfiguration(qualityAttributeThresholds: qualityAttributeThresholds)

SizeTooSmallValidator and SizeTooLargeValidator thresholds

  • Threshold of SizeTooSmallValidator and SizeTooLargeValidator is using a new definition of face size. You get the new threshold by dividing the old threshold by 4.

Before

SizeTooSmallValidator(minDetectionSizeToImageShorterSideRatioThreshold: 0.64)
SizeTooLargeValidator(maxDetectionSizeToImageShorterSideRatioThreshold: 0.8)

After

SizeTooSmallValidator(minDetectionSizeToImageShorterSideRatioThreshold: 0.16)
SizeTooLargeValidator(maxDetectionSizeToImageShorterSideRatioThreshold: 0.2)

DetectionPosition.sizeToImageShorterSideRatio value

  • This new value fits the definition of the face size. You get the new value by dividing the old value by 4.