PerchEye Logo PerchEye SDK

How to Use PerchEye SDK

Adding facial recognition to your mobile app is simple with PerchEye SDK. Choose your platform and follow these easy steps to get started.

1

Add the SDK to Your Android Project

Add the PerchEye SDK to your Android project by adding the dependency to your app's build.gradle file:

// Add the dependency
dependencies {
    implementation(files("libs/perch-eye-1.0.3-4.aar"))
}
2

Initialize and Enroll Face

Initialize the SDK and enroll a face to generate a unique identity hash:

val perchEye = PerchEye(context)
perchEye.init()
perchEye.openTransaction()

val result = perchEye.addImage(bitmap)
if (result == ImageResult.SUCCESS) {
    val hash = perchEye.enroll()
    // Store hash for future verification
}

perchEye.destroy()
3

Verify Face Against Stored Hash

Compare a new face image against the previously enrolled hash:

perchEye.openTransaction()
val result = perchEye.addImage(newBitmap)
if (result == ImageResult.SUCCESS) {
    val similarity = perchEye.verify(storedHash)
    val isMatch = similarity > 0.8f // Adjust threshold as needed
}
1

Add the SDK to Your iOS Project

Add the PerchEye framework to your iOS project using CocoaPods:

# Download PerchEye Framework from the official source

# Drag PerchEyeFramework.xcframework into your Xcode project

# Ensure the framework is added to Frameworks, Libraries, and Embedded Content

# Set Embed & Sign for the framework

2

Initialize and Enroll Face

Initialize the SDK and enroll a face to generate a unique identity hash:

let perchEye = PerchEyeSwift()
perchEye.openTransaction()

let result = perchEye.load(image: uiImage)
if result == .success {
    let hash = perchEye.enroll()
    // Store hash for future verification
}

perchEye.destroy()
3

Verify Face Against Stored Hash

Compare a new face image against the previously enrolled hash:

perchEye.openTransaction()
let result = perchEye.load(image: newUIImage)
if result == .success {
    let similarity = perchEye.verify(hash: storedHash)
    let isMatch = similarity > 0.8 // Adjust threshold as needed
}
1

Add the SDK to Your Flutter Project

Add the PerchEye plugin to your Flutter project:

# Run this in your Flutter project:

flutter pub add perch_eye
2

Initialize and Enroll Face

Initialize the SDK and enroll a face to generate a unique identity hash:

await PerchEye.init();
await PerchEye.openTransaction();

final result = await PerchEye.addImage(base64Image);
if (result == 'SUCCESS') {
    final hash = await PerchEye.enroll();
    // Store hash for future verification
}

await PerchEye.destroy();
3

Verify Face Against Stored Hash

Compare a new face image against the previously enrolled hash:

await PerchEye.openTransaction();
final result = await PerchEye.addImage(newBase64Image);
if (result == 'SUCCESS') {
    final similarity = await PerchEye.verify(storedHash);
    final isMatch = similarity > 0.8; // Adjust threshold as needed
}
1

Add the SDK to Your React Native Project

Install the PerchEye module for React Native:

# Using npm
npm install react-native-perch-eye

# Using yarn
yarn add react-native-perch-eye

# For iOS, run pod install
cd ios && pod install
2

Initialize and Enroll Face

Initialize the SDK and enroll a face to generate a unique identity hash:

import { openTransaction, addImage, enroll } from 'react-native-perch-eye';

await openTransaction();
const result = await addImage(base64Image);
if (result === 'SUCCESS') {
    const hash = await enroll();
    // Store hash for future verification
}
3

Verify Face Against Stored Hash

Compare a new face image against the previously enrolled hash:

import { openTransaction, addImage, verify } from 'react-native-perch-eye';

await openTransaction();
const result = await addImage(newBase64Image);
if (result === 'SUCCESS') {
    const similarity = await verify(storedHash);
    const isMatch = similarity > 0.8; // Adjust threshold as needed
}

Ready to Get Started?

Implementing facial recognition has never been easier across all platforms. Download the SDK today and add powerful face detection to your mobile app in minutes.

Download SDK View Documentation