react-native-mlkit-face-detection
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

react-native-mlkit-face-detection

Face Detection using MLKit (Currently iOS Only)

Installation

npm install react-native-mlkit-face-detection

Usage

See example app. And Typescript types.

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

module.exports = {
  plugins: [
    [
      'react-native-reanimated/plugin',
      {
        globals: ['__SKRNMLKitFaceDetectionVisionCameraFrameProcessorPlugin'],
      },
    ],

and call initialize to one of the frame processor slots (calling initializeVisionCameraDetector(options) is equivalent to calling initializeVisionCameraDetectorAtIndex(0, options))

Example:

initializeVisionCameraDetector({
  landmarkMode: 'all',
  performanceMode: 'accurate'
})

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i react-native-mlkit-face-detection

Weekly Downloads

1

Version

0.1.4

License

MIT

Unpacked Size

5.58 MB

Total Files

239

Last publish

Collaborators

  • switt