react-native-vision-camera-face-detector
Version:
Frame Processor Plugin to detect faces using MLKit Vision Face Detector for React Native Vision Camera!
36 lines • 1.32 kB
TypeScript
import React from 'react';
import type { RefObject } from 'react';
import type { CameraViewProps, CameraRef } from 'react-native-vision-camera';
import type { FaceDetectorOutputOptions } from '../specs/FaceDetectorFactory.nitro';
interface ComponentType extends Omit<CameraViewProps, 'onError'>, FaceDetectorOutputOptions {
ref?: RefObject<CameraRef | null>;
}
/**
* A view that detects {@linkcode Face}s in a Camera
* using the default front {@linkcode CameraDevice}.
*
*
* @example
* ```tsx
* function App() {
* const isFocused = useIsFocused()
* const appState = useAppState()
* const isActive = isFocused && appState === 'active'
* return (
* <Camera
* isActive={isActive}
* barcodeFormats={['all']}
* onFacesDetected={(faces) => {
* console.log(`Detected ${faces.length} faces!`)
* }}
* onError={(error) => {
* console.error(`Error detecting faces:`, error)
* }}
* />
* )
* }
* ```
*/
export declare function Camera({ onFacesDetected, onError, outputResolution, cameraFacing, autoMode, windowWidth, windowHeight, performanceMode, runLandmarks, runContours, runClassifications, minFaceSize, trackingEnabled, ...cameraProps }: ComponentType): React.JSX.Element;
export default Camera;
//# sourceMappingURL=Camera.d.ts.map