https://github.com/rodgomesc/vision-camera-face-detector
VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector
https://github.com/rodgomesc/vision-camera-face-detector
Last synced: 2 months ago
JSON representation
VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector
- Host: GitHub
- URL: https://github.com/rodgomesc/vision-camera-face-detector
- Owner: rodgomesc
- License: mit
- Created: 2021-08-17T13:07:21.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-16T23:13:34.000Z (4 months ago)
- Last Synced: 2025-05-12T03:10:59.985Z (2 months ago)
- Language: Java
- Size: 1.68 MB
- Stars: 106
- Watchers: 7
- Forks: 70
- Open Issues: 38
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# vision-camera-face-detector
VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector
## Installation
```sh
yarn add vision-camera-face-detector
```## Usage
```js
import * as React from 'react';
import { runOnJS } from 'react-native-reanimated';import { StyleSheet } from 'react-native';
import {
useCameraDevices,
useFrameProcessor,
} from 'react-native-vision-camera';import { Camera } from 'react-native-vision-camera';
import { scanFaces, Face } from 'vision-camera-face-detector';export default function App() {
const [hasPermission, setHasPermission] = React.useState(false);
const [faces, setFaces] = React.useState();const devices = useCameraDevices();
const device = devices.front;React.useEffect(() => {
console.log(faces);
}, [faces]);React.useEffect(() => {
(async () => {
const status = await Camera.requestCameraPermission();
setHasPermission(status === 'authorized');
})();
}, []);const frameProcessor = useFrameProcessor((frame) => {
'worklet';
const scannedFaces = scanFaces(frame);
runOnJS(setFaces)(scannedFaces);
}, []);return device != null && hasPermission ? (
) : null;
}```
## Contributing
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
## License
MIT