
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
react-native-vision-camera-facekit
Advanced tools
VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector and Apple Vision Camera for React Native Vision Camera v4
react-native-vision-camera-facekit
is a React Native Frame Processor Plugin for Vision Camera v4 that provides cross-platform face detection functionality. It supports:
# yarn
yarn add react-native-vision-camera-facekit
# or npm
npm install react-native-vision-camera-facekit --save
Then install pods (iOS):
cd ios && pod install && cd ..
import React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import {
Camera,
useCameraDevice,
useFrameProcessor,
} from 'react-native-vision-camera';
import { scanFaces } from 'react-native-vision-camera-facekit';
import { runOnJS } from 'react-native-reanimated';
export default function App() {
const device = useCameraDevice('front');
const [faces, setFaces] = React.useState([]);
React.useEffect(() => {
(async () => {
const status = await Camera.requestCameraPermission();
console.log('Camera permission:', status);
})();
}, []);
const frameProcessor = useFrameProcessor((frame) => {
'worklet';
try {
const detected = scanFaces(frame, {
performanceMode: 'fast',
classificationMode: 'all',
contourMode: 'all',
landmarkMode: 'all',
minFaceSize: 0.1,
trackingEnabled: false,
});
runOnJS(setFaces)(detected);
} catch (e) {
console.error('scanFaces error', e);
}
}, []);
if (!device) {
return <Text>Loading camera...</Text>;
}
return (
<View style={{ flex: 1 }}>
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={true}
frameProcessor={frameProcessor}
frameProcessorFps={5}
photo={false}
/>
</View>
);
}
scanFaces(frame: Frame, options?: FaceDetectionOptions): Face[]
frame: Frame
from Vision Camera
options (all optional):
performanceMode
: 'fast' | 'accurate'
(default 'fast'
)landmarkMode
: 'none' | 'all'
(default 'none'
)contourMode
: 'none' | 'all'
(default 'none'
)classificationMode
: 'none' | 'all'
(default 'none'
)minFaceSize
: number
(default 0.1
)trackingEnabled
: boolean
(default false
)Returns: Array of Face
objects with bounds, angles, probabilities, contours, and landmarks.
MIT © Cristofer Feliz
FAQs
VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector and Apple Vision Camera for React Native Vision Camera v4
The npm package react-native-vision-camera-facekit receives a total of 1 weekly downloads. As such, react-native-vision-camera-facekit popularity was classified as not popular.
We found that react-native-vision-camera-facekit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.