From b280ab73b62996c4ad34088753cbb0cb3908d255 Mon Sep 17 00:00:00 2001 From: Vincent Tran Date: Tue, 30 Jul 2024 14:33:30 -0700 Subject: [PATCH] feat(predictions): Add more backend-retrieved attributes to FaceTargetMatchingParams --- .../aws/models/FaceTargetMatchingParameters.kt | 4 ++++ .../aws/service/RunFaceLivenessSession.kt | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/aws-predictions/src/main/java/com/amplifyframework/predictions/aws/models/FaceTargetMatchingParameters.kt b/aws-predictions/src/main/java/com/amplifyframework/predictions/aws/models/FaceTargetMatchingParameters.kt index 35110a617b..3d28208e77 100644 --- a/aws-predictions/src/main/java/com/amplifyframework/predictions/aws/models/FaceTargetMatchingParameters.kt +++ b/aws-predictions/src/main/java/com/amplifyframework/predictions/aws/models/FaceTargetMatchingParameters.kt @@ -21,7 +21,11 @@ data class FaceTargetMatchingParameters internal constructor( val targetIouThreshold: Float, val targetIouWidthThreshold: Float, val targetIouHeightThreshold: Float, + val targetHeightWidthRatio: Float, + val faceDetectionThreshold: Float, val faceIouWidthThreshold: Float, val faceIouHeightThreshold: Float, + val faceDistanceThreshold: Float, + val faceDistanceThresholdMin: Float, val ovalFitTimeout: Int ) diff --git a/aws-predictions/src/main/java/com/amplifyframework/predictions/aws/service/RunFaceLivenessSession.kt b/aws-predictions/src/main/java/com/amplifyframework/predictions/aws/service/RunFaceLivenessSession.kt index f515248846..e30207d587 100644 --- a/aws-predictions/src/main/java/com/amplifyframework/predictions/aws/service/RunFaceLivenessSession.kt +++ b/aws-predictions/src/main/java/com/amplifyframework/predictions/aws/service/RunFaceLivenessSession.kt @@ -132,12 +132,16 @@ internal class RunFaceLivenessSession( challengeConfig: ChallengeConfig ): FaceTargetChallenge { val faceTargetMatching = FaceTargetMatchingParameters( - challengeConfig.ovalIouThreshold, - challengeConfig.ovalIouWidthThreshold, - challengeConfig.ovalIouHeightThreshold, - challengeConfig.faceIouWidthThreshold, - challengeConfig.faceIouHeightThreshold, - challengeConfig.ovalFitTimeout + targetIouThreshold = challengeConfig.ovalIouThreshold, + targetIouWidthThreshold = challengeConfig.ovalIouWidthThreshold, + targetIouHeightThreshold = challengeConfig.ovalIouHeightThreshold, + targetHeightWidthRatio = challengeConfig.ovalHeightWidthRatio, + faceDetectionThreshold = challengeConfig.blazeFaceDetectionThreshold, + faceIouWidthThreshold = challengeConfig.faceIouWidthThreshold, + faceIouHeightThreshold = challengeConfig.faceIouHeightThreshold, + faceDistanceThreshold = challengeConfig.faceDistanceThreshold, + faceDistanceThresholdMin = challengeConfig.faceDistanceThresholdMin, + ovalFitTimeout = challengeConfig.ovalFitTimeout ) return FaceTargetChallenge( ovalParameters.width,