SFaceCompare 2.6.5

SFaceCompare 2.6.5

Maintained by Geek Owl.

  • By
  • Bohdan Mihiliev

SFaceCompare: compare faces on your iOS device

CI Status iOS 11.3+ Swift 4.0+ Version License Platform

SFaceCompare is a simple library for iOS to find and compare faces. SFaceCompare works on top of dlib and OpenCV libraries. With usage of trained model.


  • Face detecting / extracting
  • Face aligment
  • Face matching

Used Libraries

  • dlib - Image processing
  • openCV - Detecting face landmarks and face alignment

These libraries were used to create SameFace.framework which src on CVDlibUtils branch


To run the example project, clone the repo, and run pod install from the Example directory first.



CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1+ is required to build SFaceCompare.

To install library, simply add the following line to your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.3'

target '<Your Target Name>' do
    pod 'SFaceCompare'

Then, run the following command:

$ pod install

Usage Example

Faces are the same Faces are different

In Your App delegate call SFaceCompare.opncvwrp.loadData() to load model related data. This Operation is long and async. So better put this before using methods from pod.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    return true

As simple as possible

// 1: Create compare object
let faceComparator = SFaceCompare(on: image1, and: image2)
// 2: Call compareFaces method with success and error handlers
faceComparator.compareFaces(success: { results in }, failure: {  error in })


SFaceCompare is owned and maintained by Bohdan Mihiliev & Anton Khrolenko


SFaceCompare is available under the MIT license. See the LICENSE file for more info.