react-native-biometric-verifier 0.0.62 → 0.0.63
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/package.json
CHANGED
|
@@ -545,17 +545,17 @@ const CaptureImageWithoutEdit = React.memo(
|
|
|
545
545
|
{isFaceCentered && (
|
|
546
546
|
<View style={styles.confidenceContainer}>
|
|
547
547
|
<Text style={styles.confidenceText}>
|
|
548
|
-
Confidence: {Math.round(antiSpoofConfidence *
|
|
548
|
+
Confidence: {Math.round(antiSpoofConfidence * 100)}%
|
|
549
549
|
</Text>
|
|
550
550
|
<View style={styles.confidenceBar}>
|
|
551
551
|
<View
|
|
552
552
|
style={[
|
|
553
553
|
styles.confidenceProgress,
|
|
554
554
|
{
|
|
555
|
-
width: `${antiSpoofConfidence *
|
|
556
|
-
backgroundColor: antiSpoofConfidence >
|
|
555
|
+
width: `${antiSpoofConfidence * 100}%`,
|
|
556
|
+
backgroundColor: antiSpoofConfidence * 100 > 40
|
|
557
557
|
? Global.AppTheme.success
|
|
558
|
-
: antiSpoofConfidence >
|
|
558
|
+
: antiSpoofConfidence * 100 > 20
|
|
559
559
|
? Global.AppTheme.warning
|
|
560
560
|
: Global.AppTheme.error
|
|
561
561
|
}
|
|
@@ -29,6 +29,7 @@ const MIN_FACE_CENTERED_FRAMES = 2;
|
|
|
29
29
|
// Performance optimization constants
|
|
30
30
|
const MAX_FRAME_PROCESSING_TIME_MS = 500;
|
|
31
31
|
const BATCH_UPDATE_THRESHOLD = 3;
|
|
32
|
+
const REAL_LAPLACIAN_THRESHOLD = 3500;
|
|
32
33
|
|
|
33
34
|
export const useFaceDetectionFrameProcessor = ({
|
|
34
35
|
onStableFaceDetected = () => { },
|
|
@@ -39,7 +40,7 @@ export const useFaceDetectionFrameProcessor = ({
|
|
|
39
40
|
isLoading = false,
|
|
40
41
|
isActive = true,
|
|
41
42
|
livenessLevel,
|
|
42
|
-
antispooflevel =
|
|
43
|
+
antispooflevel = 0.35,
|
|
43
44
|
}) => {
|
|
44
45
|
const { detectFaces } = useFaceDetector({
|
|
45
46
|
performanceMode: 'fast',
|
|
@@ -247,6 +248,7 @@ export const useFaceDetectionFrameProcessor = ({
|
|
|
247
248
|
);
|
|
248
249
|
});
|
|
249
250
|
|
|
251
|
+
|
|
250
252
|
// Optimized frame processor
|
|
251
253
|
const frameProcessor = useFrameProcessor(
|
|
252
254
|
(frame) => {
|
|
@@ -363,9 +365,11 @@ export const useFaceDetectionFrameProcessor = ({
|
|
|
363
365
|
if (antiSpoofResult != null) {
|
|
364
366
|
state.antiSpoof.lastResult = antiSpoofResult;
|
|
365
367
|
|
|
366
|
-
const confidence =
|
|
368
|
+
const { laplacianScore = 0, confidence = 0, combinedScore = 0 } = antiSpoofResult;
|
|
367
369
|
|
|
368
|
-
if (
|
|
370
|
+
if (laplacianScore > REAL_LAPLACIAN_THRESHOLD &&
|
|
371
|
+
confidence > antispooflevel &&
|
|
372
|
+
combinedScore > antispooflevel) {
|
|
369
373
|
state.antiSpoof.consecutiveLiveFrames = Math.min(
|
|
370
374
|
REQUIRED_CONSECUTIVE_LIVE_FRAMES,
|
|
371
375
|
state.antiSpoof.consecutiveLiveFrames + 1
|