@sssxyd/face-liveness-detector 0.4.1-beta.1 → 0.4.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1629,7 +1629,7 @@ class MotionLivenessDetector {
|
|
|
1629
1629
|
return this.config;
|
|
1630
1630
|
}
|
|
1631
1631
|
isReady() {
|
|
1632
|
-
return this.
|
|
1632
|
+
return this.normalizedLandmarksHistory.length >= 5; // 只需要5帧就能检测
|
|
1633
1633
|
}
|
|
1634
1634
|
reset() {
|
|
1635
1635
|
this.eyeAspectRatioHistory = [];
|
|
@@ -1662,7 +1662,7 @@ class MotionLivenessDetector {
|
|
|
1662
1662
|
}
|
|
1663
1663
|
}
|
|
1664
1664
|
// 数据不足时,继续收集
|
|
1665
|
-
if (this.
|
|
1665
|
+
if (!this.isReady()) {
|
|
1666
1666
|
return new MotionDetectionResult(true, {
|
|
1667
1667
|
frameCount: Math.max(this.eyeAspectRatioHistory.length, this.mouthAspectRatioHistory.length)
|
|
1668
1668
|
});
|