Choose your path
There are two ways to get started with FaceNet Android:Download APK
Fastest way to try the app (recommended)
Build from source
For developers who want to customize the app
Option 1: Download APK
The quickest way to try FaceNet Android is to download the pre-built APK.Download the APK
Visit the GitHub Releases page and download the latest APK file.
Enable installation from unknown sources
On your Android device, go to Settings > Security and enable “Install unknown apps” for your browser or file manager.
Option 2: Build from source
If you want to customize the app or contribute to development, you can build it from source.Open in Android Studio
Launch Android Studio and select File > Open, then choose the cloned directory.
Sync Gradle
Android Studio will automatically prompt you to sync Gradle. Click Sync Now and wait for dependencies to download.
Building from source requires Android Studio Hedgehog or newer with Gradle 8.0+.
Using the app
Once you have the app installed, follow these steps to recognize faces:Add faces to the database
Select images
Tap Select Images and choose one or more photos containing the person’s face. The app will automatically detect and crop faces from each image.
Recognize faces in real-time
Point the camera at a face
The app will:
- Detect faces in each camera frame
- Generate embeddings for detected faces
- Search the database for the nearest matching embedding
- Display the person’s name if the similarity exceeds the threshold (0.3)
Understanding recognition results
The app uses cosine similarity to determine if a detected face matches someone in the database:- Distance > 0.3: Face is recognized and the person’s name is displayed
- Distance ≤ 0.3: Face is not recognized, displays “Not recognized”
ImageVectorUseCase.kt:89-101:
You can adjust this threshold by modifying the value in
ImageVectorUseCase.kt:93. Lower values are more strict (fewer false positives), higher values are more lenient (fewer false negatives).Anti-spoofing detection
The app includes liveness detection to prevent recognition using photos or videos. When a face is detected, the spoof detection result is displayed:- Real: The face appears to be a real person
- Spoof: The face appears to be a photo, screen, or 3D model
Next steps
Configuration
Learn how to customize the FaceNet model, search algorithm, and face detector
Architecture
Understand how the app works under the hood