Detect, Recognition face in offline
npm install react-native-biometrics-faceA powerful, offline face recognition and verification library for React
Native.
It uses Google ML Kit for high-speed face detection and TensorFlow Lite
(mobile_face_net) for accurate face recognition. It compares two face
images and determines if they belong to the same person.
- 100% Offline: No internet connection required. Your data stays
on the device.
- Fast & Accurate: Uses mobile-optimized AI models.
- Privacy First: No images are sent to any cloud server.
- Cross Platform: Works on iOS (Swift) and Android (Kotlin).
- New Architecture Support: Fully compatible with React Native's
New Architecture (Fabric) and the Old Architecture.
`` bash`
yarn add react-native-biometrics-faceor
npm install react-native-biometrics-face
` bash`
cd ios
pod install
No additional setup is required. The library automatically links the
necessary ML models.
This library processes Base64 images. It does not access the camera
directly.
` xml`
` xml`
` ts
import { verifyFaces } from 'react-native-biometrics-face';
const compareFaces = async (sourceImageBase64: string, targetImageBase64: string) => {
const response = await verifyFaces(sourceImageBase64, targetImageBase64);
if (response.result?.isMatch) {
console.log("Faces Match!", response.result.accuracy);
} else {
console.log("Faces Do Not Match");
}
};
`
` ts`
{
statusCode: number;
message: string;
result: {
isMatch: boolean;
distance: number;
accuracy: number;
} | null;
}
- Model file not found (Android): Ensure assets are not stripped.
- iOS linker issues: Run pod install` again.
- Multiple faces detected: Ensure only one face is visible.
MIT
Developed with ❤️ by Vasanth