@sssxyd/face-liveness-detector 0.4.0-alpha.7 → 0.4.0-alpha.9

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 CHANGED
@@ -116,7 +116,7 @@ const DEFAULT_OPTIONS = {
116
116
  motion_liveness_strict_photo_detection: false,
117
117
  // Screen Capture Detection Settings
118
118
  screen_capture_confidence_threshold: 0.7,
119
- screen_capture_detection_strategy: 'adaptive',
119
+ screen_capture_detection_strategy: 'accurate',
120
120
  screen_moire_pattern_threshold: 0.65,
121
121
  screen_moire_pattern_enable_dct: true,
122
122
  screen_moire_pattern_enable_edge_detection: true,
@@ -4811,6 +4811,22 @@ class FaceDetectionEngine extends SimpleEventEmitter {
4811
4811
  this.scheduleNextDetection(this.options.detect_error_retry_delay);
4812
4812
  return;
4813
4813
  }
4814
+ else {
4815
+ this.emitDebug('screen-capture-detection', 'No screen capture detected', {
4816
+ isScreenCapture: screenResult.isScreenCapture,
4817
+ overallConfidence: screenResult.confidenceScore,
4818
+ minConfidenceThreshold: this.options.screen_capture_confidence_threshold,
4819
+ detectionStrategy: screenResult.strategy,
4820
+ riskLevel: screenResult.riskLevel,
4821
+ processingTimeMs: screenResult.processingTimeMs,
4822
+ executedMethods: screenResult.executedMethods.map((m) => ({
4823
+ method: m.method,
4824
+ isScreenCapture: m.isScreenCapture,
4825
+ confidence: m.confidence
4826
+ })),
4827
+ skippedMethods: screenResult.skippedMethods
4828
+ });
4829
+ }
4814
4830
  // 运动检测
4815
4831
  const motionResult = this.detectionState.motionDetector.analyzeMotion(grayFrame, face, faceBox);
4816
4832
  if (this.detectionState.motionDetector.isReady()) {
@@ -5003,6 +5019,7 @@ class FaceDetectionEngine extends SimpleEventEmitter {
5003
5019
  this.emitDetectorInfo({ code: DetectionCode.MULTIPLE_FACE, faceCount: faceCount });
5004
5020
  }
5005
5021
  if (this.detectionState.period !== DetectionPeriod.DETECT) {
5022
+ this.emitDebug('detection', 'Multiple or no faces detected, resetting detection state', { faceCount });
5006
5023
  this.resetDetectionState();
5007
5024
  }
5008
5025
  this.scheduleNextDetection();