Face Detect Demo sample project

The Face Detect Demo sample project demonstrates facial features detection based on the VisageSDK::FacialFeaturesDetector class and face recognition based on the VisageSDK::VisageFaceRecogition class.


The application needs to be rebuilt with license key in order to work properly. More information on how to obtain license key and include it in the application can be found in Licensing section of the documentation.

Building and running the project

The FaceDetectDemo sample projects is located in the Samples/iOS/FaceDetectDemo sub-folder of the visage|SDK for iOS folder.

Prerequisites to running the sample project are installed Xcode (version 14.0+) and an iOS device (iPhone 5s / iPad 5 or newer). Sample project will also work in the simulator.

Project is opened in Xcode by double-clicking on the FaceDetectDemo.xcodeproj project file. To run the project an iOS device first must be attached to the computer and selected as active scheme in Xcode project. The project sample application can than be run by choosing Run option in Xcode.

Using the sample application

The sample application consists of a two buttons: Detect and Match faces. Detect button loads an image from the device gallery. If any features were detected, they are drawn on the loaded image and shown on the screen. Match faces button loads an image bundled with the sample application and performs face recognition on it. As a result, name of the recognized person (or the name of the person with the most similar face found in the VisageFaceRecognition gallery) will be drawn on the loaded image and shown on the screen. Sample images are provided in data/images sub-folder of visage|SDK for iOS folder which can be added to device gallery.

NOTE: Without a valid license an error message will appear and face detection and recognition will not work.

Implementation overview

The visage|SDK API is written in C++ and since development on iOS is done in Objective-C a special way of interfacing the two must be employed. In this sample project this is done through VisageFeaturesDetectorWrapper and VisageFaceRecognitionWrapper, Objective-C classes that exposes Objective-C methods for using the detector and recognizer, while the implementation of those methods is done in Objective-C++, a combination of Objective-C and C++.

The FaceDetectViewController (Objective-C class) connects with GUI (that is defined in MainWindow.xib file) and implements actions that calls to methods from VisageFeaturesDetectorWrapper and VisageFaceRecognitionWrapper classes in order to detect and display facial features altogether with face recognition.

The specific classes and methods that demonstrate visage|SDK are:

Other important classes are:

More details about each class is available in documentation for specific class.

Users are free to modify the sample project to test the functionalities of the Facial Features Detector. The sample project also serves as a starting point when creating new projects that will use visage|SDK.