FaceAI SDK is on_device Offline Face Detection 、Recognition 、Liveness Detection Anti Spoofing and 1:N/M:N Face Search SDK
This repository demonstrates both face liveness detection
and face recognition
technology for React-Native
on Android
and iOS
platforms.
In this repository, we integrated
FaceAI SDK
'sface liveness detection
andface recognition
technology into theReact-Native
project for bothAndroid
andiOS
.
This is on-premise face recognition SDK
which means everything is processed in your phone and NO data leaves the device.
This library follows the React Native releases support policy.
It is supporting the latest version, and the two previous minor series.
$ npm install --save react-native-face-recognition
# --- or ---
$ yarn add react-native-face-recognition
## API Usages
#### 2.1 FaceRecognitionAPI
- Activate the `FaceRecognitionAPI` by calling the `setActivation` method:
```kotlin
var ret = await FaceRecognitionAPI.setActivation("...");
console.log("set activation:", ret);
- Initialize the
FaceRecognitionAPI
by calling theinitSDK
method:
var ret = await FaceRecognitionAPI.initSDK();
- Set parameters using the
setParam
method:
var ret = await FaceRecognitionAPI.setParam(checkLivenessLevel);
- Extract faces using the
extractFaces
method:
var faceBoxes = await FaceRecognitionAPI.extractFaces(uri);
- Calculate the similarity between faces using the
similarityCalculation
method:
const similarity = await FaceRecognitionAPI.similarityCalculation(
face.templates,
person.templates
);
- To build the native camera screen and process face detection, please refer to the example/App.tsx file in the repository.