Skip to content

Repository files navigation

FacePlugin

🌐 Company Site - Here

πŸ€— Hugging Face - Here

πŸ›Ÿ Help Center - Here

🐳 Docker Hub - Here

FacePlugin Face Recognition SDK β€” iOS (Fully On-Premise)

Ready in ~10 minutes (after framework download): Unzip facerecognitionsdk.framework.zip (and the engine / ONNX zips) into this folder β†’ Run on a phone Jump: Quick start Β· Get the framework Β· Run the demo Β· Setup Β· About SDK Β· Demo kit

Customer repo: FaceRecognition-iOS Β· Help Center: doc.faceplugin.com

Quick start checklist

  • Clone https://github.com/Faceplugin-ltd/FaceRecognition-iOS
  • Download the three .zip files from Google Drive
  • Unzip into this folder (facerecognitionsdk.framework, FaceRecognitionEngine.framework, onnxruntime.framework)
  • Open FaceRecognitionSDK.xcodeproj β†’ set your Team β†’ Run on a physical iPhone
  • Home status bar hides β†’ Enroll / Identify / Capture / Attribute unlock

Your own app? Skip to Setup on your own app. Optional copy-paste helpers: Demo kit.

Introduction

FacePlugin Face Recognition SDK for iOS is a fully on-device biometric engine for KYC and mobile onboarding. Enroll faces from gallery, identify in 1:N with live camera and 2D liveness, capture with an oval coach, and read attributes (liveness, quality, pose, age, gender, glasses, emotion, and more).

All processing stays on the iPhone. No biometric data is sent to FacePlugin cloud β€” built for banking, access control, and privacy-first identity apps.

This repository is the iOS demo app β€” a standalone customer repo. Runtime is facerecognitionsdk.framework at the repo root (download from Google Drive). No other FacePlugin repository is required.

Two layers:

  1. facerecognitionsdk.framework β€” native engine (detect, templates, VideoWorker).
  2. FaceRecognitionKit/ β€” copy-paste Swift helpers (FaceRecognitionClient) so you can call every SDK function without rewriting threading, AVFoundation, or VideoWorker plumbing. See Demo kit.

Main Functionalities

Demo tile What it does
Enroll Enroll a person from a gallery photo (exactly one face) into the on-device database
Identify Live 1:N camera match (VideoWorker, stop on first hit) with 2D liveness / anti-spoofing
Capture Oval coach capture β†’ still with attributes β†’ optional enroll
Attribute Gallery analysis: landmarks, liveness, pose, quality, age, gender, emotion
Settings Camera lens, identify / liveness / pose / eye-close thresholds
About FacePlugin Face Recognition SDK β€” on-device identity

Also: 14-point landmarks, template extraction, 1:N similarity, and offline license.

Product List

Platform Repository
Android (Recognition) FaceRecognition-Android
iOS (Recognition) FaceRecognition-iOS (this repo)
React Native (Recognition) FaceRecognition-React-Native
Flutter (Recognition) FaceRecognition-Flutter
Ionic Capacitor (Recognition) FaceRecognition-Ionic-Capacitor
Ionic Cordova (Recognition) FaceRecognition-Ionic-Cordova
Windows (Recognition) FaceRecognition-Windows
Linux / Docker (Recognition) FaceRecognition-Docker
Android (Liveness) FaceLivenessDetection-Android
iOS (Liveness) FaceLivenessDetection-iOS
Windows (Liveness) FaceLivenessDetection-Windows
Linux / Docker (Liveness) FaceLivenessDetection-Docker

Before you start

Step What you need
1 Xcode 15+ and a physical iPhone (camera + liveness need a real device)
2 facerecognitionsdk.framework in this folder β€” see Get the framework
3 Demo license is already in the repo (licenseKey for com.faceplugin.facerecognitionsdk). Request a new key only if you change bundle id β€” see SDK License

You can run the sample app as-is. Enroll / Identify / Capture / Attribute stay dimmed until the engine finishes loading (the status bar then hides).

System requirements

Item Minimum Recommended
iOS 13.0 16 or newer
Device iPhone with A12 or newer Recent iPhone
RAM 4 GB 6 GB or more
Camera Front camera 720p or 1080p
Device Physical device Same; simulator is not for camera / liveness

Get the framework (facerecognitionsdk.framework)

facerecognitionsdk.framework is a header stub on GitHub because the binary is too large. On Drive it is shipped as zips β€” unzip after you download.

Where to download

FaceRecognitionSDK-iOS-App runtime (Google Drive) β€” files: facerecognitionsdk.framework.zip, FaceRecognitionEngine.framework.zip, onnxruntime.framework.zip

How to place it

  1. Clone this repo (if you have not already):
git clone https://github.com/Faceplugin-ltd/FaceRecognition-iOS.git
cd FaceRecognition-iOS
  1. Download the .zip files from the Drive folder.
  2. Unzip each one (double-click in Finder, or unzip facerecognitionsdk.framework.zip). You should get .framework folders β€” not the .zip.
  3. Put the unzipped frameworks here (repo root, next to FaceRecognitionSDK.xcodeproj β€” not in a nested folder, and not the zip files):
FaceRecognition-iOS/
β”œβ”€β”€ FaceRecognitionSDK.xcodeproj
β”œβ”€β”€ FaceRecognitionKit/                 ← Swift module (in this repo)
β”œβ”€β”€ FaceRecognitionSDK/                 ← demo UI
β”œβ”€β”€ facerecognitionsdk.framework/       ← unzipped (not .zip)
β”œβ”€β”€ FaceRecognitionEngine.framework/    ← unzipped (not .zip)
└── onnxruntime.framework/              ← unzipped (not .zip)

If unzip creates the .framework folders in Downloads, move them into this repo. You can delete the .zip files afterward.

Run the demo

  1. Open FaceRecognitionSDK.xcodeproj in Xcode.
  2. Run on a device. The demo already has a valid licenseKey for com.faceplugin.facerecognitionsdk.
  3. Set your Team for signing if needed.

Keep bundle id com.faceplugin.facerecognitionsdk for the included license.

The home status bar shows Loading native SDK… and then hides on success. Errors (Invalid license!, License expired!, No activated!, Init error!) stay on screen. Enroll / Identify / Capture / Attribute stay disabled until activation succeeds.

If the app crashes at launch in dyld (SIGABRT / __abort_with_payload), Xcode may have embedded a ~50KB Swift link stub instead of the real facerecognitionsdk. The Sync Embedded Frameworks build phase re-copies the vendor frameworks after every build (scripts/sync_embedded_frameworks.sh). If it still happens: Product β†’ Clean Build Folder (β‡§βŒ˜K) and Run again.

Screenshots

Home Identify Capture

FacePlugin Face Recognition β€” Home with Enroll, Identify, Capture, Attribute, Settings, About

FacePlugin Face Recognition β€” live 1:N identify with face box, landmarks, and liveness

FacePlugin Face Recognition β€” oval capture coach with Move closer

Capture result Attribute Attribute (emotion)

FacePlugin Face Recognition β€” capture result with liveness, quality, and Enroll

FacePlugin Face Recognition β€” attributes: 14 landmarks, liveness, age, gender

FacePlugin Face Recognition β€” attributes: emotion, mask, glasses, quality

Attribute (quality) Settings About

FacePlugin Face Recognition β€” quality: pose, box, luminance, landmarks

FacePlugin Face Recognition β€” Settings for camera lens and thresholds

FacePlugin Face Recognition SDK β€” About, on-device identity

Attribute (liveness) Attribute (landmarks)

FacePlugin Face Recognition β€” liveness spoof score, age, gender

FacePlugin Face Recognition β€” 14 landmark coordinates

SDK License

Licenses are offline and bound to your bundle identifier.

The sample app already includes a valid key for com.faceplugin.facerecognitionsdk. You only need a new key if you use a different bundle identifier.

How to get a license

The code below shows how to use the license:

/// `FP1.…` from FacePlugin for bundle id `com.faceplugin.facerecognitionsdk`.
private let licenseKey =
"FP1.RlBMMQMAAQAPZoIUMnHWbZlL37gIAgAAiwzjjvfWBtUpvi7HaaTdfTrWZ3SyD4S949NuAmIeafdSruIt8Px7395zNLVjVa/aT8kpgeKHkUTBHXMxzDfTO3b72UxOx45PoVeJzpPUb74M4suMNcan7jDn4fpIlHA/7KSDKO4X4fPU7DC/hhvdlbWKJ3WCvRoNNP9LsR+PlkCHsMHuaTbtqGB+7LqM9UbE/BMSBArJ79dDXV/fg52WAZ3WRQ74wZeEuCoR/L2hv+blZ2ulYjl5w1DegJt4lxzTGdjdSN07AaiJ6GuilXcoald/F8eTzCRlFyLbF44dAOfLbEKAcWxIWRnV3pPP6eljlHnRCHQ95dOfZvzU1aJQF2a52buBK+L9yaDVEixjHrBHf03toU1WJ9WOqhSJW1yzbzTimNpcHQWptaB7LBVe5B5Ji1LluU7/UL4WamkcEoPIbwNg2pLgJtTOXYF1hZPA+l2U41ncSMTIsiENlMxUnpc3I2upTbw57EDWrBQO6lSXXbqh/vxHsD3LPcjgxfkXir+okr5MfkWd6iQopT4zAAJ4jV02uRWNNONX5dMGmKIXlgB6fYGNgitDfgj6Sk07tiFqLPQldLviKLZQrZJNfiBZLsNy1/8t/eXZ55L6rhJ31UY8vsQ+48KJuqb5FTcZ4p0DGlKWrpkBAi95pkOu0M3ZZMg0j65GPGU9RtKIjWqiZhjR87tzSIoAMIGHAkIA2w3qAKi99nTgIqZ0kLP1MtY2wK/w6ERXFk2KswYQVHSWIwlZd8ZVbfFt9cnV3hmY44YH6evpb8O19WpoqlKN2dQCQTbcYtr7WoqfL1DUAZlEMbGDp6qqQuVVx3jjW+9Dac/csw+GkNyy4fREMGBJSbPfqLJSnu9yTPaF8GoOqvKpwl7s"

private func activateSDK() {
sdkLoading = true
setSdkActionsEnabled(false)
warningLabel.isHidden = false
warningLabel.text = "Loading native SDK…"
FaceRecognitionClient.shared.activate(license: licenseKey) { [weak self] code in
guard let self else { return }
self.sdkLoading = false
self.sdkReady = code == 0
if self.sdkReady {
FaceRecognitionClient.shared.loadDatabase()
self.warningLabel.isHidden = true
self.setSdkActionsEnabled(true)
self.refreshPeople()
} else {
self.setSdkActionsEnabled(false)
self.warningLabel.isHidden = false
self.warningLabel.text = switch code {
case 1: "Invalid license!"
case 2: "License expired!"
case 3: "No activated!"
default: "Init error!"
}
}
}

Please contact us to get a license for your own app.

Setup on your own app

Copy FaceRecognitionKit (Swift module) and the vendor frameworks into your project, request a license for your bundle id, activate once at launch, then call the kit APIs used in the demo screens.

  1. Add facerecognitionsdk.framework, FaceRecognitionEngine.framework, and onnxruntime.framework to your target (Embed & Sign).
  2. Copy the FaceRecognitionKit folder from this repo into your project.
  3. Activate at launch:
FaceRecognitionClient.shared.activate(license: "FP1.…") { code in
    // 0 = success β€” enable camera / gallery UI
}
  1. Camera / photo permissions in Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera is used to capture and identify faces.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo library is used to enroll and analyze faces.</string>

The license is bound to your bundle id. Request a key for that id, not the demo’s.

Call SDK work off the main thread via FaceRecognitionClient.shared.async { … }. First init unpacks on-device models (expect a few seconds). Then follow About SDK. Full API: doc.faceplugin.com.

About SDK

Use FaceRecognitionKit (FaceRecognitionClient.shared) in Swift, or call FaceRecognitionSDK from Objective-C++. All work stays on the device. 0 = success.

Call once per process, off the main thread: activate(license:) (setActivation β†’ initSDK). The engine is not concurrent β€” serialize calls (or copy the Demo kit). Do not copy ViewController / IdentifyCameraViewController unless you want the demo UI.

Your product needs Call this
Start the engine activate(license:)
Find a face / attributes faceDetection (purpose .fullAttributes)
Save a person templateExtraction β†’ store Data in your DB
1:1 / 1:N similarity (or kit bestMatch)
Live camera box + 1:N VideoWorker (start β†’ syncDatabase β†’ addFrame)
Stop stopVideoWorker then deactivate
FaceRecognitionClient.shared.activate(license: "FP1.…") { code in
    if code == 0 {
        FaceRecognitionClient.shared.loadDatabase()
        // enable Enroll / Identify / Capture / Attribute
    }
}

Feed upright, unmirrored frames into detect / VideoWorker. Mirror boxes on the overlay only. Stills downscale to long side 1280; live frames ~640 is enough.

let prepared = CameraFrameUtils.enginePreparedImage(image)
let faces = FaceRecognitionClient.shared.faceDetection(from: prepared, purpose: .fullAttributes)
guard faces.count == 1, let template = FaceRecognitionClient.shared.templateExtraction(from: prepared, face: faces[0]) else { return }
let hit = FaceRecognitionClient.shared.bestMatch(for: template, threshold: 0.67)
Code Meaning
0 Activate / init OK
1 Invalid license
2 Expired license
3 Not activated
4 Init failed

Demo kit

FaceRecognitionKit/ is not inside the framework. Copy that Swift folder if you want the demo’s wiring instead of calling FaceRecognitionSDK yourself.

Use FaceRecognitionClient.shared as the only entry. Do not mix raw FaceRecognitionSDK.* on other threads while the client is running.

File Use it for
FaceRecognitionClient Activate, detect, enroll, 1:N, VideoWorker
SDKQueue Serial native access; live addFrame does not block the camera
FaceDatabase Local enrolled people (Documents/face_database.json)
CameraFrameUtils CMSampleBuffer β†’ upright image; gallery ≀ 1280; live ≀ 640
LiveDetect / IdentityLiveness Live 2D liveness / eyes + active-liveness configs
FaceJSON / FaceModels Parse detect JSON and VideoWorker events
let client = FaceRecognitionClient.shared
client.activate(license: "FP1.…") { code in
    if code == 0 { client.loadDatabase() }
}

Camera preview bind lives in the demo (BaseCameraViewController), not the kit.

Skip the kit if you already have a camera pipeline and a person DB β€” then call FaceRecognitionSDK on one background queue.

Contact

faceplugin.com  faceplugin.com

About

Face recognition SDK iOS with passive liveness detection (Face Detection, Face Landmarks, Face Recognition, Face Liveness, Face Pose, Face Expression, Face attributes)

Topics

Resources

Stars

70 stars

Watchers

5 watching

Forks

Releases

Packages

Contributors

Languages