Faceplugin-ltd/FaceRecognition-Android

Face Recognition, Face Liveness Detection, Face Anti-Spoofing, Face Detection, Face Landmarks, Face Compare, Face Matching, Face Pose, Face Expression, Face Attributes, Face Templates Extraction, Face Landmarks

FacePlugin Face Recognition SDK – Android demo

What it is

  • A sample Android app that showcases FacePlugin’s on‑device face‑recognition SDK. The heavy lifting lives in a binary AAR (facerecognitionsdk.aar) that you download separately and drop into the project.

Key capabilities

Feature What the demo does
Enroll Takes a single face from the gallery and stores its template in a local JSON database.
Identify Live 1‑to‑N matching using the phone’s front camera, with 2‑D liveness/anti‑spoof detection.
Capture Guided oval‑coach capture that returns a face image plus attributes and can optionally enroll the person.
Attribute Analyzes a gallery photo for landmarks, pose, quality, age, gender, emotion, liveness, etc.
Settings Lets you tweak camera lens choice and thresholds for liveness, pose, eye‑closure, etc.
About Shows information about the SDK and its offline licensing model.

How to run it

  1. Clone the repo.
  2. Download the facerecognitionsdk.aar from the linked Google‑Drive folder and place it in libfacesdk/.
  3. Open the project in Android Studio and run on a real Android phone (the demo disables the UI until the native SDK finishes loading).
  4. The app ships with a valid license key for the demo package ID; for your own app you must request a new key.

Using the SDK in your own project

  • Add the libfacesdk module and the AAR to your Gradle build.
  • Call FaceRecognitionSDK.setActivation(context, licenseKey) followed by init(context) once, on a background thread.
  • The public API includes:
    • faceDetection – returns detection boxes, landmarks and any requested attributes.
    • templateExtraction – converts a face image to a byte‑array template you store yourself.
    • similarityCalculation – compare two templates (1:1) or loop for 1:N search.
    • VideoWorker – helper for continuous camera frames, handling live liveness and incremental matching.
  • The repository also provides a demo kit (app/src/main/java/.../kit/) with ready‑made Kotlin helpers (FaceRecognitionClient, FaceDatabase, camera utilities, etc.) that you can copy‑paste to avoid writing threading and CameraX plumbing.

Why it matters

  • On‑device only: No images or biometric data leave the phone, which is crucial for privacy‑sensitive use‑cases such as banking KYC, access control, or any app that must comply with data‑protection regulations.
  • Offline licensing: The SDK works without an internet connection after you activate it with a license bound to your app’s package name.
  • Multi‑platform ecosystem: FacePlugin offers matching SDKs for iOS, React‑Native, Flutter, Ionic, Windows, and Docker, all using the same underlying models.

Getting help

Bottom line If you need a turnkey, privacy‑first face‑recognition solution for Android, this repo gives you a working demo and a set of copy‑paste Kotlin helpers to integrate the commercial FacePlugin SDK into your own app.

Related

  • Project
  • Project
  • Project
  • Project
  • Project