A mobile face recognition app that detects, enrolls, and recognizes faces fully offline on-device.
demo.mp4
Use a physical device with a front camera. Simulator and emulator runs are not part of the supported setup.
| Platform | Required device | Minimum version |
|---|---|---|
| iOS | Real iPhone with a front camera | iOS 15.1+ |
| Android | Real arm64-v8a device with a front camera |
API 24+ |
You also need reasonable lighting and a live person. Passive liveness detection is enabled for enrollment and recognition.
- Node
>= 22.11.0 - Bun
- iOS: macOS, Xcode 16.1+, Ruby
>= 2.6.10, and Bundler - Android: JDK 17+, Android SDK 36, and NDK
27.1.12297006
Use Bun for this repo. Do not mix in npm or Yarn.
git clone https://github.com/margelo/face-recognition-demo.git
cd face-recognition-demo
bun install --frozen-lockfileFor iOS, install pods:
bun run podBefore the first iOS device build, open the workspace:
open ios/FaceRecognition.xcworkspaceSelect the FaceRecognition target, then choose your Apple development team
under Signing & Capabilities. If Xcode reports that the bundle identifier is
unavailable, change it to a unique value.
Start Metro in one terminal:
bun startIn another terminal, build and launch on a connected physical device.
iOS:
bun run ios --deviceAndroid:
bun run androidOn first launch, allow camera permission. If permission is denied, re-enable it in system settings and relaunch the app.
- Launch the app.
- Confirm the camera preview appears.
- Point the front camera at a face and confirm an unlabeled face box appears.
- Tap
ENROLL, enter a name, tapSTART CAPTURE, and follow the capture prompts. - Return to the scanner and confirm the enrolled face is labeled.
- Force-quit and reopen the app, then confirm the identity still matches.
bun run lint
bunx tsc --noEmit
bun run --cwd modules/react-native-face-recognition typecheck
bun run --cwd modules/react-native-face-recognition format:cpp:check
bun run --cwd modules/react-native-face-recognition lint:cpp