FaceRecognition - Flutter

This demo app demonstrates face recognition and face liveness detection by mitigating biometric fraud based on Flutter framework for both Android and iOS.

Overview

The demo project demonstrates both Face Liveness Detection and Face Recognition Technology.

It stands for face recognition Flutter, facial recognition Flutter, face liveness check Flutter, spoofing prevention Flutter, face matching Flutter, face comparison Flutter, face search engine Flutter, face identification Flutter.

SDK

Standard SDK - AndroidStandard SDK - iOS

Github

Google Play

YouTube

Screenshots

How to Run

1. Flutter Setup

Make sure you have Flutter installed.

We have tested the project with Flutter version 3.10.2.

If you don't have Flutter installed, please follow the instructions provided in the official Flutter documentation:

2. Running the App

Run the following commands:

flutter pub upgrade
flutter run

If you plan to run the iOS app, please refer to the following link for detailed instructions:

FaceSDK Plugin

1. Setup

1.1 'Face SDK' Setup

Android

  • Copy the SDK (libfacesdk folder) to the 'android' folder of your project.

  • Add SDK to the project in settings.gradle

include ':libfacesdk'

1.2 'FaceSDK Plugin' Setup

  • Copy 'facesdk_plugin' folder to the root folder of your project.

  • Add the dependency in your pubspec.yaml file.

  facesdk_plugin:
    path: ./facesdk_plugin
  • Import the facesdk_plugin package.

  import 'package:facesdk_plugin/facesdk_plugin.dart';
  import 'package:facesdk_plugin/facedetection_interface.dart';

2. API Usage

2.1 FacesdkPlugin

  • Activate the 'FacesdkPlugin' by calling the 'setActivation' method:

  final _facesdkPlugin = FacesdkPlugin();
  ...
  await _facesdkPlugin
          .setActivation("...")
          .then((value) => facepluginState = value ?? -1);  
  • Initialize the 'FacesdkPlugin':

await _facesdkPlugin
          .init()
          .then((value) => facepluginState = value ?? -1)
  • Set parameters using the 'setParam' method:

await _facesdkPlugin
        .setParam({'check_liveness_level': livenessLevel ?? 0})
  • Extract faces using the 'extractFaces' method:

final faces = await _facesdkPlugin.extractFaces(image.path)
  • Calculate similarity between faces using the 'similarityCalculation' method:

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

2.2 FaceDetectionInterface

To build the native camera screen and process face detection, please refer to the following file in the Github repository.

This file contains the necessary code for implementing the camera screen and performing face detection.

Last updated