Skip to content

Commit

Permalink
fix(liveness): Read facematch timeout from server event JSON (#2577)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Leing <leint@amazon.com>
Co-authored-by: gpanshu <91897496+gpanshu@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 13, 2023
1 parent 2298d7f commit 7a9343b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ data class FaceTargetMatchingParameters internal constructor(
val targetIouWidthThreshold: Float,
val targetIouHeightThreshold: Float,
val faceIouWidthThreshold: Float,
val faceIouHeightThreshold: Float
val faceIouHeightThreshold: Float,
val ovalFitTimeout: Int
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ internal data class ChallengeConfig(
@SerialName("OvalIouWidthThreshold") val ovalIouWidthThreshold: Float,
@SerialName("OvalIouHeightThreshold") val ovalIouHeightThreshold: Float,
@SerialName("FaceIouWidthThreshold") val faceIouWidthThreshold: Float,
@SerialName("FaceIouHeightThreshold") val faceIouHeightThreshold: Float
@SerialName("FaceIouHeightThreshold") val faceIouHeightThreshold: Float,
@SerialName("OvalFitTimeout") val ovalFitTimeout: Int
)
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ internal class RunFaceLivenessSession(
challengeConfig.ovalIouWidthThreshold,
challengeConfig.ovalIouHeightThreshold,
challengeConfig.faceIouWidthThreshold,
challengeConfig.faceIouHeightThreshold
challengeConfig.faceIouHeightThreshold,
challengeConfig.ovalFitTimeout
)
val faceTargetChallenge = FaceTargetChallenge(
ovalParameters.width,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,19 @@ internal class LivenessEventStreamTest {
faceMovementAndLightChallenge = FaceMovementAndLightServerChallenge(
ovalParameters = OvalParameters(1.0f, 2.0f, .5f, .7f),
lightChallengeType = LightChallengeType.SEQUENTIAL,
challengeConfig = ChallengeConfig(1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f),
challengeConfig = ChallengeConfig(
1.0f,
1.1f,
1.2f,
1.3f,
1.4f,
1.5f,
1.6f,
1.7f,
1.8f,
1.9f,
10
),
colorSequences = listOf(
ColorSequence(FreshnessColor(listOf(0, 1, 2)), 4.0f, 5.0f)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ internal class LivenessWebSocketTest {
1.6f,
1.7f,
1.8f,
1.9f
1.9f,
10
),
colorSequences = listOf(
ColorSequence(FreshnessColor(listOf(0, 1, 2)), 4.0f, 5.0f)
Expand Down

0 comments on commit 7a9343b

Please sign in to comment.