Help Center
  • Welcome to KBY-AI
  • Product
    • Face Liveness Detection SDK, Face Recognition SDK
      • Basic SDK - Mobile
        • Basic SDK - Android
        • Basic SDK - iOS
      • Standard SDK - Mobile
        • Standard SDK - Android
        • Standard SDK - iOS
      • Premium SDK - Mobile
        • Premium SDK - Android
        • Premium SDK - iOS
      • Face Liveness Detection SDK - Server
      • Face Recognition SDK - Server
    • ID Card Recognition SDK
      • ID Card Recognition SDK - Android
      • ID Card Recognition SDK - iOS
      • ID Card Recognition SDK - Server
      • Supported Documents
      • Result Parsing
    • ID Document Liveness Detection SDK
    • ID Document Auto Capture Web
    • Palm Recognition SDK
      • Palmprint Recognition SDK - Server
      • Palmvein Recognition SDK - Server
    • Automatic License Plate/Number Recognition SDK
      • License Plate Recognition-Server
      • License Plate Recognition-Flutter
      • License Plate Recognition-Android
    • Computer Vision Solutions
      • Fire/Smoke Detection-Server
  • Demo Projects
    • Mobile (Android, iOS)
      • FaceLivenessDetection - Android
      • FaceLivenessDetection - iOS
      • FaceRecognition - Android
      • FaceRecognition - iOS
      • FaceRecognition - Flutter
      • FaceRecognition - Ionic-Cordova
      • FaceRecognition - React-Native
      • FaceAttribute - Android
      • FaceAttribute - iOS
      • FaceAttribute - Flutter
      • IDCardRecognition - Android
      • IDCardRecognition - iOS
      • License Plate Recognition-Flutter
      • License Plate Recognition-Android
    • Server (Windows, Linux)
      • FaceLivenessDetection - Windows
      • FaceLivenessDetection - Docker
      • FaceLivenessDetection - C# - .NET
      • FaceRecognition - Windows
      • FaceRecognition - Docker
      • FaceRecognition - C# - .NET
      • IDCardRecognition - Windows
      • IDCardRecognition - Docker
      • IDCardRecognition - C# - .NET
      • Palm Print Recognition SDK - Docker
      • Palm Vein Recognition SDK - Docker
      • License Plate Recognition-Docker
      • License Plate Recognition - C# - .NET
  • FAQ
    • How can I set up a Kubernetes system?
    • Has KBY-AI's facial algorithm been certified by a reliable standard measurement authority?
    • Accelerating KBY-AI SDKs with Kubernetes Configuration
Powered by GitBook
On this page
  • Overview
  • Github
  • Google Play
  • YouTube
  • Screenshots
  • How to Run
  • 1. Flutter Setup
  • 2. Running the App
  • FaceSDK Plugin
  • 2. API Usage
  1. Demo Projects
  2. Mobile (Android, iOS)

FaceAttribute - Flutter

This Flutter demo app demonstrates face recognition, face liveness detection, face auto-capture, age/gender detection, automatic face capture, face quality facial occlusion, eye closure.

PreviousFaceAttribute - iOSNextIDCardRecognition - Android

Last updated 15 days ago

Overview

This demo project integrates several facial recognition technologies, including 3D passive face liveness detection, face recognition, automatic face capture, and analysis of various face attributes such as age, gender, face quality, facial occlusion, eye closure, and mouth opening.

The system utilizes face liveness detection technology to generate a real-time liveness score based on a single image captured by the camera.

Additionally, the demo offers face recognition capabilities, enabling enrollment from a gallery and real-time identification of faces captured by the camera.

The demo also features an automatic face capture function that verifies various facial attributes, such as face quality, facial orientation (yaw, roll, pitch), facial occlusion (e.g., mask, sunglass, hand over face), eye closure, mouth opening, and the position of the face within the region of interest (ROI).

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.22.3.

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 clean
flutter pub get
flutter run

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

FaceSDK Plugin

1.1 `Face SDK` Setup

Android

  • Copy the SDK (libfacesdk folder) to the android folder in 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 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(
              "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,
      'check_eye_closeness': true,
      'check_face_occlusion': true,
      'check_mouth_opened': true,
      'estimate_age_gender': true
    });
  • Extract face feature 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.

GitHub - kby-ai/FaceAttribute-Flutter: Flutter face attribute: face liveness detection, face recognition, face auto-capture, and analysis of face attributes including age, gender, face quality, face occlusion, eye closure, and mouth openingGitHub
GitHub - kby-ai/FaceAttribute-Flutter: Flutter face attribute: face liveness detection, face recognition, face auto-capture, and analysis of face attributes including age, gender, face quality, face occlusion, eye closure, and mouth openingGitHub
Face Attribute - Apps on Google PlayGooglePlay
Logo
Logo
Installflutterdev
flutter installation reference
Logo
Build and release an iOS appflutterdev
Logo
Logo