DOT Android Face 6.0.0
This guide describes how to migrate DOT Android Face version 5.x to version 6.0.0. Only the most important changes are highlighted in this guide. For more details, see the Android sample.
Migration Steps (Kotlin)
DotFaceLibrary component
- Replace
isInitialized()instance call with Kotlin idiomatic way.
Before
DotFaceLibrary.getInstance().isInitialized
After
DotFaceLibrary.isInitialized()
Face Auto Capture UI component (FaceAutoCaptureFragment)
- Replace usage of
FaceAutoCaptureFragment. More details are in the integration manual and the API reference. - Replace
onStepChanged()withonProcessed(). ArgumentcaptureStepIdis no longer available.
Before
override fun onStepChanged(captureStepId: CaptureStepId, detectedFace: DetectedFace) {
// Handle detection data after internal auto capture change
}
override fun onCaptured(detectedFace: DetectedFace) {
// Handle result
}
After
override fun onProcessed(detection: FaceAutoCaptureDetection) {
val detectedFace = detection.detectedFace
// Handle detection data after each frame is processed
}
override fun onCaptured(result: FaceAutoCaptureResult) {
val detectedFace = result.detectedFace
// Handle result
}
Face Simple Capture UI component (FaceSimpleCaptureFragment)
- Replace usage of
FaceSimpleCaptureFragment. More details are in the integration manual and the API reference.
Before
override fun onCaptured(detectedFace: DetectedFace) {
// Handle result
}
After
override fun onCaptured(result: FaceSimpleCaptureResult) {
val detectedFace = result.detectedFace
// Handle result
}
Data class FaceAutoCaptureConfiguration
- Replace
qualityAttributes()withqualityAttributeThresholds()inFaceAutoCaptureConfiguration.Builder.
Before
val configuration = FaceAutoCaptureConfiguration.Builder()
.qualityAttributes(PassiveLivenessQualityProvider().qualityAttributes)
.build()
After
val configuration = FaceAutoCaptureConfiguration.Builder()
.qualityAttributeThresholds(QualityAttributeThresholdPresets.passiveLiveness.build())
.build()
Quality attributes of the output image
- Replace
MatchingQualityProviderwithQualityAttributeThresholdPresets.standard. - Replace
IcaoQualityProviderwithQualityAttributeThresholdPresets.icao. - Replace
PassiveLivenessQualityProviderwithQualityAttributeThresholdPresets.passiveLiveness. - Replace extension of
MatchingQualityProviderwithqualityAttributeThresholds()inFaceAutoCaptureConfiguration.Builder.
Before
class MatchingWithGlassesStatusQualityProvider : MatchingQualityProvider() {
init {
qualityAttributes.add(QualityAttribute.of(QualityAttributeId.GLASS_STATUS, ValueRange.of(0.0, 0.5), ValueRange.of(0.0, 0.5)))
}
}
After
val qualityAttributeThresholds = QualityAttributeThresholdPresets.standard
.maxGlassesPresenceScore(0.5)
.build()
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.