UNPKG

@the-horizon-dev/fast-face-detection

Version:

Fast face detection package using TensorFlow.js MediaPipe models for browser and Node.js environments

44 lines (43 loc) 1.53 kB
/** * Main entry point for the fast-face-detection library */ import { DetectionOptions, MediaElement, PossiblyTrackedFace, PossiblyTrackedFaceDetectionWithLandmarks, Environment, DetectionResult } from './types'; /** * Main API for facial detection */ export declare const mediapipeFace: { /** * Detects faces in an image or video element */ detectFaces: <T extends boolean = false>(input: MediaElement, options?: DetectionOptions, withTiming?: T) => Promise<T extends true ? DetectionResult<PossiblyTrackedFace> : PossiblyTrackedFace[]>; /** * Detects faces with facial landmarks */ detectFacesWithLandmarks: <T extends boolean = false>(input: MediaElement, options?: DetectionOptions, withTiming?: T) => Promise<T extends true ? DetectionResult<PossiblyTrackedFaceDetectionWithLandmarks> : PossiblyTrackedFaceDetectionWithLandmarks[]>; /** * Releases resources used by the library */ dispose: () => void; /** * Explicitly initializes face detection models */ initialize: (options?: DetectionOptions) => Promise<Environment>; }; /** * Utilities for facial detection */ export declare const utils: { /** * Sets the library's logging level */ setLogLevel: (level: "debug" | "info" | "warn" | "error" | "none") => void; /** * Current version of the library */ VERSION: string; }; export * from './types'; export { FaceAPI } from './core'; export * from './core'; export * from './utils'; export * from './services';