Package Exports
- react-native-perch-eye
- react-native-perch-eye/src/index.tsx
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-perch-eye) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
๐ง Perch Eye SDK React Native Documentation
The Perch Eye SDK for React Native allows you to extract unique face hashes from image sequences and verify them against new images. The SDK is built using TensorFlow and C++ and provides high performance for mobile applications, with zero dependencies.
๐ง Integration
Install the native module:
npm install react-native-perch-eye
๐ง Initialization
import { init, destroy } from 'react-native-perch-eye';
await init(); // Init native engine
await destroy(); // Cleanup
Note: These methods are called natively by the module lifecycle, so manual calls are usually not required.
๐ Usage
๐ Enroll - Create Hash From Face Images
To create a face hash from a sequence of base64 images:
import { openTransaction, addImage, enroll } from 'react-native-perch-eye';
await openTransaction();
await addImage(base64Image1);
await addImage(base64Image2);
// ...
const hash = await enroll();
๐งช Verify - Compare New Face With Stored Hash
To compare a new image sequence against a previously created hash:
import { openTransaction, addImage, verify } from 'react-native-perch-eye';
await openTransaction();
await addImage(base64ImageNew);
// ...
const similarity = await verify(hash);
โก Compare a list
Compares a list of base64-encoded images against a face hash.
import { evaluate, compareList } from 'react-native-perch-eye';
const hash = await evaluate(base64Images);
const similarity = await compareList(base64Images, hash);
โก Optional: Direct Face Comparison
Convenience method: Internally performs:
openTransaction()
addImage(image1)
โenroll()
โopenTransaction()
โaddImage(image2)
โverify()
import { compareFaces } from 'react-native-perch-eye';
const sim = await compareFaces(img1, img2);
โ Error Codes
addImage method error codes :
// Returned string:
"SUCCESS" |
"FACE_NOT_FOUND" |
"FILE_NOT_FOUND" |
"TRANSACTION_NOT_OPEN" |
"SDK_NOT_INITIALIZED" |
"INTERNAL_ERROR"
โ Summary
- Minimal, high-performance Flutter SDK for face hash comparison.
- Zero dependencies, designed for mobile applications.
- Works with both base64 and raw RGBA face images.
- Includes methods for enrolling, verifying, and comparing face hashes.