Faceplugin Docs
  • Welcome to Faceplugin
  • Face Recognition SDK
    • Face Recognition Android SDK
    • Face Recognition iOS SDK
    • Face Recognition React Native SDK
    • Face Recognition Flutter SDK
    • Face Recognition Ionic-Cordova SDK
    • Face Recognition Dot Net SDK
    • Open Source Face Recognition Windows SDK
    • Open Source Face Recognition Linux SDK
    • Open Source Face Recognition Javascript SDK
    • Open Source Face Recognition React SDK
    • Open Source Face Recognition Vue SDK
  • Liveness Detection SDK
    • Liveness Detection Android SDK
    • Liveness Detection iOS SDK
    • Liveness Detection Linux SDK
  • Palm Recognition SDK
    • Palm Recognition SDK
  • Request a License & Support
  • Contact US
Powered by GitBook
On this page
  • Code
  • How to Run
  • APIs
  • 1. Usage of FacesdkPlugin
  • 2. Working with camera stream
  1. Face Recognition SDK

Face Recognition Flutter SDK

Face recognition Flutter SDK with liveness detection

PreviousFace Recognition React Native SDKNextFace Recognition Ionic-Cordova SDK

Last updated 1 month ago

Code

How to Run

1. Set Up Flutter Development Environment

2. How to Run the App

flutter pub upgrade
flutter run

APIs

1. Usage of FacesdkPlugin

Activate the FacesdkPlugin

To activate the FacesdkPlugin, use the setActivation method with your activation key:

final _facesdkPlugin = FacesdkPlugin();
...
await _facesdkPlugin
    .setActivation(
        "Os8QQO1k4+7MpzJ00bVHLv3UENK8YEB04ohoJsU29wwW1u4fBzrpF6MYoqxpxXw9m5LGd0fKsuiK"
        "fETuwulmSR/gzdSndn8M/XrEMXnOtUs1W+XmB1SfKlNUkjUApax82KztTASiMsRyJ635xj8C6oE1"
        "gzCe9fN0CT1ysqCQuD3fA66HPZ/Dhpae2GdKIZtZVOK8mXzuWvhnNOPb1lRLg4K1IL95djy0PKTh"
        "BNPKNpI6nfDMnzcbpw0612xwHO3YKKvR7B9iqRbalL0jLblDsmnOqV7u1glLvAfSCL7F5G1grwxL"
        "Yo1VrNPVGDWA/Qj6Z2tPC0ENQaB4u/vXAS0ipg==")
    .then((value) => facepluginState = value ?? -1);  

Initialize FacesdkPlugin

Before using the SDK, initialize it with the init method:

await _facesdkPlugin
    .init()
    .then((value) => facepluginState = value ?? -1);

Set Parameters

Configure the SDK settings using setParam:

await _facesdkPlugin
    .setParam({'check_liveness_level': livenessLevel ?? 0});

Extract Face Features

Use the extractFaces method to detect and extract face features from an image:

final faces = await _facesdkPlugin.extractFaces(image.path);

Calculate Face Similarity

Compare two face templates and calculate their similarity score:

double similarity = await _facesdkPlugin.similarityCalculation(
    face['templates'], person.templates) ?? -1;

2. Working with camera stream

Native Camera Integration & Face Detection

You can refer to Flutter to setup enviroment.

If you are going to run the iOS app, please refer to this for detailed instructions.

To integrate the native camera and implement real-time face detection and processing, refer to in the GitHub repository:

official document
documentation
this file
GitHub - Faceplugin-ltd/FaceRecognition-Flutter: Face recognition SDK Flutter Plugin with 3D passive liveness detection (Face Detection, Face Landmarks, Face Recognition, Face Liveness, Face Pose, Face Expression, Face attributes)GitHub
Logo