@sssxyd/face-liveness-detector 0.4.0-alpha.2 → 0.4.0-alpha.3

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.js CHANGED
@@ -4072,6 +4072,10 @@
4072
4072
  this.completedActions.add(this.currentAction);
4073
4073
  this.currentAction = null;
4074
4074
  }
4075
+ setCVInstance(cvInstance) {
4076
+ this.motionDetector?.setCVInstance(cvInstance);
4077
+ this.screenDetector?.setCVInstance(cvInstance);
4078
+ }
4075
4079
  /**
4076
4080
  * Clear action verify timeout
4077
4081
  */
@@ -4151,6 +4155,7 @@
4151
4155
  }
4152
4156
  this.options = mergeOptions(options);
4153
4157
  this.detectionState = createDetectionState(this.options);
4158
+ this.detectionState.setCVInstance(this.cv);
4154
4159
  }
4155
4160
  getEngineState() {
4156
4161
  return this.engineState;
@@ -4189,10 +4194,8 @@
4189
4194
  console.log('[FaceDetectionEngine] OpenCV loaded successfully', {
4190
4195
  version: cv_version
4191
4196
  });
4192
- // Inject OpenCV instance into motion detector
4193
- if (this.detectionState.motionDetector) {
4194
- this.detectionState.motionDetector.cv = cv;
4195
- }
4197
+ // Inject OpenCV instance into motion detector and screen detector
4198
+ this.detectionState.setCVInstance(this.cv);
4196
4199
  // Load Human.js
4197
4200
  console.log('[FaceDetectionEngine] Loading Human.js models...');
4198
4201
  this.emitDebug('initialization', 'Loading Human.js...');