facezk-core
Version:
ZKP-AI Proof of Humanity: Live Selfie Check with Biometric Template Extraction and Fuzzy Hashing
65 lines • 1.97 kB
TypeScript
/**
* Liveness Detection
* ZK-AI Proof of Humanity: Anti-Spoofing and Challenge Detection
*/
import type { LivenessResult, LivenessChallenge, FaceZKConfig } from '../types';
/** Frame analysis result */
export interface FrameAnalysis {
/** Frame timestamp */
timestamp: number;
/** Face mesh points */
mesh: number[][];
/** Eye closure states */
eyes: {
left: {
closed: boolean;
confidence: number;
};
right: {
closed: boolean;
confidence: number;
};
};
/** Head pose */
headPose: {
yaw: number;
pitch: number;
roll: number;
};
/** Mouth state */
mouth: {
open: boolean;
confidence: number;
};
/** Smile detection */
smile: {
detected: boolean;
confidence: number;
};
}
/** Liveness detection state */
export interface LivenessState {
/** Collected frame analyses */
frames: FrameAnalysis[];
/** Current challenge being performed */
currentChallenge?: LivenessChallenge;
/** Challenge start time */
challengeStartTime: number;
/** Challenge completion status */
challenges: {
[key in LivenessChallenge['type']]: {
completed: boolean;
confidence: number;
frames: number;
};
};
}
/** Initialize liveness detection state */
export declare function initializeLivenessState(): LivenessState;
/** Analyze single frame for liveness detection */
export declare function analyzeFrame(mesh: number[][]): FrameAnalysis;
/** Update liveness detection state with new frame */
export declare function updateLivenessState(state: LivenessState, frame: FrameAnalysis, config: FaceZKConfig): LivenessState;
/** Generate liveness result from state */
export declare function generateLivenessResult(state: LivenessState, config: FaceZKConfig): LivenessResult;
//# sourceMappingURL=detector.d.ts.map