| """Lightweight face-engine stub for CI (no InsightFace / ONNX load).""" |
| from __future__ import annotations |
|
|
| import threading |
| from typing import Any |
|
|
| import numpy as np |
|
|
|
|
| class StubFaceEngine: |
| app = None |
| lock = threading.Lock() |
|
|
| def __init__(self): |
| self.db: dict[str, np.ndarray] = {} |
|
|
| def reload_db(self) -> None: |
| with self.lock: |
| self.db = {} |
|
|
| def match_frame(self, frame: np.ndarray, threshold: float | None = None) -> dict[str, Any]: |
| return {"found": False, "reason": "CI stub — face recognition disabled in CI"} |
|
|
| def recognize(self, frame: np.ndarray) -> list[dict[str, Any]]: |
| return [] |
|
|