Faceplugin-ltd/FaceRecognition-LivenessDetection-Android
概要
On-device face recognition & liveness detection SDK for Android. 1:1 face verification, 1:N face identification and face matching, plus passive anti-spoofing and presentation attack detection. Fully on-premise, no cloud, for eKYC and identity verification.
AI・機械学習できること
- Recognition - Detection, attributes, quality, templates, 1:1 similarity, and 1:N identification
- Liveness - Passive anti-spoofing on camera frames and stills
計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- -1
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナル
🌐 Company Site - Here
🤗 Hugging Face - Here
🛟 Help Center - Here
🐳 Docker Hub - Here
FacePlugin Face Recognition + 1:N Identification + Liveness Detection — Android (Fully On-Premise)
Jump: Quick start · Get the library · Run the demo · SDK License · Setup on your own app · About SDK
Quick start
- Clone FaceRecognition-LivenessDetection-Android
- Download
facerecognitionsdk.aarfrom Releases intolibs/— Get the library - Open the folder in Android Studio and run
:appon a physical phone - The demo ships with a license key for
com.faceplugin.facerecognitionsdk; contact us for your ownapplicationId
Introduction
FacePlugin Face Recognition + Liveness Detection for Android runs face recognition and passive liveness entirely on the device. Nothing is sent to a FacePlugin server, which is what banking, access control, and privacy-first identity apps need. Its headline capability is 1:N identification: enroll your people once, then ask who is this? of a camera frame or a photo and get a ranked candidate list back — searched against a gallery that lives on the phone, so no face ever leaves it.
This repository is the whole product: the engine (libs/facerecognitionsdk.aar), two helper libraries you add to your project, and a demo app built from those same libraries — so what you read here is what the demo runs.
Main Functionalities
| Feature | API |
|---|---|
| 1:N identification against the on-device gallery | FaceGallery.identify |
| Face detection (bounding box, landmarks, pose, attributes) | FaceDetector.detect |
| Passive liveness (anti-spoofing) | face.liveness · FaceLimits.isLive |
| Face image quality | face.face_quality |
| Face template extraction and similarity | FaceDetector.template · FaceDetector.similarity |
| Enrollment with duplicate check | FaceGallery.enroll |
| Guided camera capture (oval overlay, live coaching) | FaceCaptureActivity |
| License and engine lifecycle | FaceEngine.start · FaceEngine.licenseStatus · FaceEngine.machineCode |
Product List
| Platform | Repository |
|---|---|
| Android | FaceRecognition-LivenessDetection-Android (this repo) |
| iOS | FaceRecognition-LivenessDetection-iOS |
| React Native | FaceRecognition-LivenessDetection-ReactNative |
| Flutter | FaceRecognition-LivenessDetection-Flutter |
| .NET MAUI | FaceRecognition-LivenessDetection-DotNet-MAUI |
| Ionic Cordova | FaceRecognition-LivenessDetection-Ionic-Cordova |
| Ionic Capacitor | FaceRecognition-LivenessDetection-Ionic-Capacitor |
Related products
- Face Liveness Detection — Android — FaceLivenessDetection-Android — liveness only
- Face Liveness Detection — iOS — FaceLivenessDetection-iOS — liveness only
- Face Recognition — Windows — FaceRecognition-Windows — on-premise server
- Face Recognition — Docker — FaceRecognition-Docker — on-premise server
Before you start
| Step | What you need |
|---|---|
| 1 | Android Studio (Hedgehog or newer) and Java 17 |
| 2 | libs/facerecognitionsdk.aar from the release page — see Get the library |
| 3 | A physical phone. The emulator has no usable camera for liveness |
| 4 | A license key for your applicationId (contact us). The demo already has one for com.faceplugin.facerecognitionsdk |
System requirements
| Item | Minimum | Recommended |
|---|---|---|
| Android | minSdk 24 (Android 7.0) |
Android 10 or newer |
| ABI | arm64-v8a or armeabi-v7a |
arm64-v8a |
| RAM | 4 GB | 6 GB or more |
| CPU | 4+ cores | Mid-range SoC from ~2019 or newer |
| Camera | Front camera | 1080p, autofocus |
| Device | Physical device | Same; the emulator is not for camera work |
Get the library (facerecognitionsdk.aar)
libs/facerecognitionsdk.aar is empty on GitHub because the binary is too large. Gradle fails fast when the file is missing.
Download the engine from Releases
git clone https://github.com/Faceplugin-ltd/FaceRecognition-LivenessDetection-Android.git
cd FaceRecognition-LivenessDetection-Android
Put the file here — not in a nested folder:
FaceRecognition-LivenessDetection-Android/
└── libs/
└── facerecognitionsdk.aar
The engine is about 80 MB, so use ABI splits or an app bundle for release builds.
Run the demo
- Open this folder in Android Studio.
- Select a physical device and Run. Keep
applicationIdascom.faceplugin.facerecognitionsdk— the bundled license key is tied to it. - Wait for the engine to report Ready before using the camera.
The demo is the :app module, with five tabs:
| Tab | What it shows |
|---|---|
| Identify | Live 1:N against everyone enrolled, with liveness, then a result screen with the ranked matches |
| People | Add one person with the capture coach, add many from photos or a folder, search, edit, delete |
| Attribute | Every face in a photo: liveness, quality, detection score, pose, expression, age, gender, landmarks, closest match |
| Liveness | Live anti-spoofing check on the camera feed |
| Settings | Match, liveness, and pose thresholds; license status |
Screenshots
SDK License
The demo runs as it is: a FacePlugin key for com.faceplugin.facerecognitionsdk is already in the code. Licenses are offline — once activated, nothing phones home — and each one is bound to your applicationId, so your own app needs its own key.
Set your SDK license
| What | File | What to find |
|---|---|---|
| The key itself | BuiltInLicense.kt |
const val KEY |
| Where it is used | ShellApp.kt |
FaceEngine.start(this, BuiltInLicense.KEY) |
| The id it is bound to | app/build.gradle |
applicationId |
Find this, and put your key in place of the demo one:
const val KEY =
"FP1.RlBMMQMAAQDJx5NBpyjuxrTSuz8MAgAA…"
Rebuild and run. The Settings tab shows the license state, and the engine reports NOT_ACTIVATED, LICENSE_INVALID or LICENSE_EXPIRED when a key does not fit the app.
How to get a key
Contact us with the id you will ship. If we ask for a machine code, FaceEngine.machineCode(context) returns it. After activation, FaceEngine.licenseStatus() reports what the key unlocks.
License capabilities (Recognition + Liveness)
| Capability | Meaning |
|---|---|
| Recognition | Detection, attributes, quality, templates, 1:1 similarity, and 1:N identification |
| Liveness | Passive anti-spoofing on camera frames and stills |
Setup on your own app
You integrate from this repository — there is no package server, no Maven coordinate, and no remote dependency to add.
Clone this repository and put
facerecognitionsdk.aarinlibs/(above).Copy the two library modules into your project (or point at the clone):
face-recognition-kit/ FaceEngine, FaceGallery, FaceDetector, FaceLimits, image and camera helpers face-recognition-capture/ FaceCaptureActivity, CaptureView, FaceCaptureState (optional capture coach)settings.gradle:include ':face-recognition-kit' include ':face-recognition-capture' // only if you want the capture coachapp/build.gradle— the app supplies the engine, because an Android library cannot package a local.aar:android { defaultConfig { minSdk 24 ndk { abiFilters 'arm64-v8a', 'armeabi-v7a' } } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } } dependencies { implementation project(':face-recognition-kit') implementation project(':face-recognition-capture') implementation files(rootProject.file('libs/facerecognitionsdk.aar')) }Start the engine once per process, with your license key.
You do not need the demo's :app module. Full wiring, permissions, and result JSON: https://doc.faceplugin.com
About SDK
Activate once at start-up, then call the engine. The first start loads the on-device models, so it takes a few seconds. Call it from a background thread.
1. Activate and initialize
// Application.onCreate
FaceEngine.start(context, "YOUR_LICENSE_KEY") { code ->
// code == IdentityEngine.SUCCESS when the engine is ready
}
FaceEngine.addListener { state -> /* LOADING, READY, NOT_ACTIVATED, LICENSE_EXPIRED, … */ }
FaceEngine.isReady
FaceEngine.licenseStatus()
FaceEngine.machineCode(context)
2. Read a face
val faces = FaceDetector.detect(bitmap, FaceDetectionParam.allAttributes())
val face = faces.first()
face.liveness; face.face_quality; face.yaw; face.roll; face.pitch
face.age; face.genderLabel; face.smile; face.mouth_opened
val template = FaceDetector.template(bitmap, face) // 1040 bytes
val score = FaceDetector.similarity(templateA, templateB)
3. Enroll and identify (1:N)
val gallery = FaceGallery.get(context)
when (val outcome = gallery.enroll("Mina Ortiz", "Front desk", photo, limits)) {
is EnrollOutcome.Enrolled -> outcome.record.id // and outcome.duplicate, outcome.report
is EnrollOutcome.Rejected -> outcome.reason
}
when (val outcome = gallery.identify(probe, limits, livenessOn = true)) {
is IdentifyOutcome.Done -> outcome.result.primary.best // name, id, similarity
is IdentifyOutcome.Rejected -> outcome.reason // no face, liveness failed, no template
}
Enrolled people live in SQLite, with their photos in app-private storage. Ids are never reused.
4. The capture coach (optional)
Subclass FaceCaptureActivity for the oval guide, live coaching, and a hold-to-capture that only fires on a good frame:
class AddPersonActivity : FaceCaptureActivity() {
override fun resultPanelLayout() = R.layout.view_enroll_panel
override fun limits() = myLimits
override fun onCaptureAnalyzed(face: FaceBox?, faceCount: Int) { /* capturedPhoto(), retakeCapture() */ }
}
5. Thresholds
FaceLimits holds every threshold the checks use, so the library never reads your settings:
val limits = FaceLimits(
match = 0.80f, // lowest similarity that counts as the same person
liveness = 0.50f, // lowest liveness score that counts as a live face
yaw = 20f, roll = 20f, pitch = 20f,
)
FaceLimits.DEFAULT is the engine's operating points. The helpers isLive, poseOk, and matches apply the same rule everywhere, so the capture coach, identify, and the attribute screen agree.
6. What each action did
enroll, identify, and attributes return a CallReport: the engine calls they made, what each returned, whether it passed, and how long it took.
report.success
report.totalMs
report.steps // faceDetection, templateExtraction, similarity, duplicateCheck, save…
report.steps[0].detail // "1 face"
Contact
関連プロジェクトを探す
読み込み中…