Face Detection using MLKit
npm install react-native-mlkit-face-detectionFace Detection using MLKit
(Currently iOS Only)
``sh`
npm install react-native-mlkit-face-detection
See example app. And Typescript types.
`ts
import { MLKitFaceDetector } from "react-native-mlkit-face-detection";
// ...
const detector = MLKitFaceDetector({
landmarkMode: 'all'
});
// frame is a frame of video from react-native-native-video`
detector.process(frame)
For Vision Camera to work, you must add the babel plugin
``ts``
module.exports = {
plugins: [
[
'react-native-reanimated/plugin',
{
globals: ['__SKRNMLKitFaceDetectionVisionCameraFrameProcessorPlugin'],
},
],initializeVisionCameraDetector(options)
and call initialize to one of the frame processor slots (calling is equivalent to calling initializeVisionCameraDetectorAtIndex(0, options))
Example:
`ts``
initializeVisionCameraDetector({
landmarkMode: 'all',
performanceMode: 'accurate'
})
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT