PerchEye SDK provides advanced facial recognition functionality for iOS applications, enabling face detection, enrollment, verification, and comparison using embedded TensorFlow Lite models.
Initialize the SDK before performing any operations:
let perchEye = PerchEyeSwift()Always destroy the SDK instance to free resources when done:
perchEye = nil || perchEye.destroy()Represents operation results from image processing methods:
Success: Operation completed successfully.FaceNotFound: No face detected in the provided image.TransactionNotOpened: Attempted operation without an open transaction.SDKNotInitialized: SDK was not initialized properly.InternalError: An internal error occurred within SDK.
Initializes the PerchEye SDK.
PerchEyeSwift()Frees resources allocated by the SDK.
perchEye.destroy()Opens a transaction required before loading or comparing images.
perchEye.openTransaction()Loads an image into the PerchEye SDK for processing.
let result: ImageResult = perchEye.load(image: uiImage)Verifies an image against a given hash string. At the end of processing this method, the 'transaction' will be closed.
let similarity: Float = perchEye.verify(hash: base64Hash)Enrolls the currently loaded image and returns a Base64-encoded hash. At the end of processing this method, the 'transaction' will be closed.
let hash: String = perchEye.enroll()Evaluates an array of images and returns a combined Base64-encoded hash.
let hash: String = perchEye.evaluate(arrayOfImages)Compares an array of images with a given hash string.
let similarity = perchEye.compare(images: arrayOfImages, withHash base64Hash)let perchEye = PerchEyeSwift()
perchEye.openTransaction()
let result = perchEye.load(image: uiImage)
if (result == .success) {
let base64Hash = perchEye.enroll()
let similarity = perchEye.verify(hash: base64Hash)
}
perchEye.destroy()(void)perchInit– Loads TFLite model.(void)destroy– Releases SDK resources.(void)openTransaction– Starts a new session.(ImageResult)loadImage:(UIImage *)image– Loads an image throughUIImage.(NSString *)enroll– Returns face embeddings.(float)verify:(NSString *)hash– Computes verification score.(NSString *)evaluateWithImages:(NSArray<UIImage *> *)images– Returns aggregated embeddings.(float)compareImages:(NSArray<UIImage *> *)images withHash:(NSString *)hashString– Compares embeddings and returns similarity score. Ensure proper lifecycle management ((void)perchInitand(void)destroy) to avoid memory leaks and ensure stable operation.