Mamasodikov / FaceRecognition-Flutter

Face recognition Flutter demo project with face liveness detection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

👏 Product List

https://github.com/kby-ai/Product

👏 We have published the Face Liveness Detection, Face Recognition SDK and ID Card Recognition SDK for the server.

FaceRecognition-Flutter

Overview

This project is a Face Recognition and Face Liveness Detection project for Flutter.

The demo is integrated with KBY-AI's Standard Face Mobile SDK.

Basic Standard Premium
Face Detection Face Detection Face Detection
Face Liveness Detection Face Liveness Detection Face Liveness Detection
Pose Estimation Pose Estimation Pose Estimation
Face Recognition Face Recognition
68 points Face Landmark Detection
Face Quality Calculation
Face Occlusion Detection
Eye Closure Detection
Age, Gender Estimation

Face Liveness Detection - Android(Basic SDK)

Face Liveness Detection - iOS(Basic SDK)

Face Recognition - Android(Standard SDK)

Face Recognition - iOS(Standard SDK)

Face Recognition - Flutter(Standard SDK)

Face Recognition - React-Native(Standard SDK)

Face Attribute - Android(Premium SDK)

Face Attribute - iOS(Premium SDK)

Try the APK

Google Play

Google Drive

https://drive.google.com/file/d/1cn_89fYDYhq8ANXs2epO-KBv7p5ZnWcA/view?usp=sharing

Screenshots

SDK License

The face recognition project relies on kby-ai's SDK, which requires a license for each application ID.

Email: contact@kby-ai.com

Telegram: @kbyai

WhatsApp: +19092802609

Skype: live:.cid.66e2522354b1049b

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: https://docs.flutter.dev/get-started/install

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: https://docs.flutter.dev/deployment/ios

About SDK

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 'Face SDK 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 Usages

2.1 FacesdkPlugin

  • Activate the 'FacesdkPlugin' by calling the 'setActivation' method:
  final _facesdkPlugin = FacesdkPlugin();
  ...
  await _facesdkPlugin
          .setActivation(
              "Os8QQO1k4+7MpzJ00bVHLv3UENK8YEB04ohoJsU29wwW1u4fBzrpF6MYoqxpxXw9m5LGd0fKsuiK"
              "fETuwulmSR/gzdSndn8M/XrEMXnOtUs1W+XmB1SfKlNUkjUApax82KztTASiMsRyJ635xj8C6oE1"
              "gzCe9fN0CT1ysqCQuD3fA66HPZ/Dhpae2GdKIZtZVOK8mXzuWvhnNOPb1lRLg4K1IL95djy0PKTh"
              "BNPKNpI6nfDMnzcbpw0612xwHO3YKKvR7B9iqRbalL0jLblDsmnOqV7u1glLvAfSCL7F5G1grwxL"
              "Yo1VrNPVGDWA/Qj6Z2tPC0ENQaB4u/vXAS0ipg==")
          .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 lib/facedetectionview.dart file in the repository.

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

About

Face recognition Flutter demo project with face liveness detection


Languages

Language:Dart 39.6%Language:C++ 15.8%Language:CMake 13.0%Language:Swift 11.5%Language:Kotlin 8.8%Language:Java 6.3%Language:Ruby 1.7%Language:HTML 1.3%Language:Objective-C 1.1%Language:C 1.0%