Skip to content

Commit 0b28789

Browse files
authored
chore: update magic number for face height (#83)
1 parent 15de0d1 commit 0b28789

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/FaceLiveness/FaceDetection/BlazeFace/DetectedFace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct DetectedFace {
3434
}
3535

3636
let faceWidth = ow
37-
let faceHeight = 1.68 * faceWidth
37+
let faceHeight = 1.618 * faceWidth
3838
let faceBoxBottom = boundingBox.maxY
3939
let faceBoxTop = faceBoxBottom - faceHeight
4040
let faceBoxLeft = min(cx - ow / 2, rightEar.x)

Tests/FaceLivenessTests/DetectedFaceTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ final class DetectedFaceTests: XCTestCase {
100100
let ovalRect = CGRect.zero
101101
let expectedBoundingBox = CGRect(
102102
x: 0.1658528943614037,
103-
y: 0.041756969751750916,
103+
y: 0.072967669448238516,
104104
width: 0.6240418540649166,
105-
height: 0.8457092820983773
105+
height: 0.8144985824018897
106106
)
107107
let boundingBox = detectedFace.boundingBoxFromLandmarks(ovalRect: ovalRect)
108108
XCTAssertEqual(boundingBox.origin.x, expectedBoundingBox.origin.x)

0 commit comments

Comments
 (0)