react-native-biometric-verifier 0.0.52 → 0.0.53
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
|
@@ -25,6 +25,7 @@ const CaptureImageWithoutEdit = React.memo(
|
|
|
25
25
|
isLoading = false,
|
|
26
26
|
frameProcessorFps = 1,
|
|
27
27
|
livenessLevel = 0, // 0 = anti-spoof only, 1 = anti-spoof + blinking
|
|
28
|
+
antispooflevel,
|
|
28
29
|
}) => {
|
|
29
30
|
const cameraRef = useRef(null);
|
|
30
31
|
const [cameraDevice, setCameraDevice] = useState(null);
|
|
@@ -203,6 +204,7 @@ const CaptureImageWithoutEdit = React.memo(
|
|
|
203
204
|
isLoading,
|
|
204
205
|
isActive: showCamera && cameraInitialized,
|
|
205
206
|
livenessLevel: livenessLevel,
|
|
207
|
+
antispooflevel:antispooflevel,
|
|
206
208
|
});
|
|
207
209
|
|
|
208
210
|
useEffect(() => {
|
|
@@ -19,7 +19,6 @@ const BLINK_THRESHOLD = 0.3;
|
|
|
19
19
|
const REQUIRED_BLINKS = 3;
|
|
20
20
|
|
|
21
21
|
// Anti-spoofing
|
|
22
|
-
const ANTI_SPOOF_CONFIDENCE_THRESHOLD = 7;
|
|
23
22
|
const REQUIRED_CONSECUTIVE_LIVE_FRAMES = 3;
|
|
24
23
|
|
|
25
24
|
// Face centering
|
|
@@ -40,6 +39,7 @@ export const useFaceDetectionFrameProcessor = ({
|
|
|
40
39
|
isLoading = false,
|
|
41
40
|
isActive = true,
|
|
42
41
|
livenessLevel = 0,
|
|
42
|
+
antispooflevel = 7,
|
|
43
43
|
}) => {
|
|
44
44
|
const { detectFaces } = useFaceDetector({
|
|
45
45
|
performanceMode: 'fast',
|
|
@@ -366,7 +366,7 @@ export const useFaceDetectionFrameProcessor = ({
|
|
|
366
366
|
const isLive = antiSpoofResult.isLive === true;
|
|
367
367
|
const confidence = antiSpoofResult.combinedScore || antiSpoofResult.neuralNetworkScore || 0;
|
|
368
368
|
|
|
369
|
-
if (isLive && confidence >
|
|
369
|
+
if (isLive && confidence > antispooflevel) {
|
|
370
370
|
state.antiSpoof.consecutiveLiveFrames = Math.min(
|
|
371
371
|
REQUIRED_CONSECUTIVE_LIVE_FRAMES,
|
|
372
372
|
state.antiSpoof.consecutiveLiveFrames + 1
|
package/src/index.js
CHANGED
|
@@ -52,6 +52,7 @@ const BiometricModal = forwardRef(({
|
|
|
52
52
|
navigation,
|
|
53
53
|
MaxDistanceMeters = 30,
|
|
54
54
|
duration = 100,
|
|
55
|
+
antispooflevel,
|
|
55
56
|
}, ref) => {
|
|
56
57
|
// Custom hooks - Initialize notification hook first
|
|
57
58
|
const { notification, fadeAnim, slideAnim, notifyMessage, clearNotification } = useNotifyMessage();
|
|
@@ -593,6 +594,7 @@ const BiometricModal = forwardRef(({
|
|
|
593
594
|
isLoading={state.isLoading}
|
|
594
595
|
frameProcessorFps={frameProcessorFps}
|
|
595
596
|
livenessLevel={livenessLevel}
|
|
597
|
+
antispooflevel={antispooflevel}
|
|
596
598
|
/>
|
|
597
599
|
</View>
|
|
598
600
|
)}
|