Face Recognition iOS SDK

Face recognition iOS SDK with liveness detection

Code

Setup

  1. Copy facesdk.frameworkdirectory to the root folder of your project.

  2. Add SDK framework to the project in Xcode

  3. Add FaceDemo-Bridging-Header.h to Build Settings

APIs

setActivation: This API is used to activate the SDK

+(int)setActivation:(NSString*)license;

Input

  • license (NSString*): The license string

Return value

The SDK activation status code.

  • 0: Success

  • Non-zero: Activation failed

initSDK: This API is used to initialize the SDK

+(int)initSDK;

Input

None

Return value

The SDK initialization status code.

  • 0: Success

  • -1: License Key Error

  • -2: License AppID Error

  • -3: License Expired

  • -4: Activate Error

  • -5: Initialize SDK Error

faceDetection: This API is used to detect faces

+(NSMutableArray*)faceDetection:(UIImage*)image;

Input

  • image (UIImage*): The input image

Return value

An array of FaceBox objects representing the detected faces.

templateExtraction: This API is used to extract face template

+(NSData*)templateExtraction:(UIImage*)image faceBox:(FaceBox*)faceBox;

Input

  • image (UIImage*): The input image

  • faceBox (FaceBox*): The bounding box of the detected face

Return value

A NSData representing the extracted template from the face

similarityCalculation: This API is used to calculate the similarity between two face templates

+(float)similarityCalculation:(NSData*)templates1 templates2:(NSData*)templates2;

Input

  • templates1 (NSData*): The first face template

  • templates2 (NSData*): The second face template

Return value

A float value representing the similarity score between the two face templates The score ranges from 0.0 to 1.0 Default Threshold is 0.8

Last updated