Skip to content

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 opening

Notifications You must be signed in to change notification settings

kby-ai/FaceAttribute-Flutter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š Product & Resources - Here

πŸ›Ÿ Help Center - Here

πŸ’Ό KYC Verification Demo - Here

πŸ™‹β€β™€οΈ Docker Hub - Here

FaceAttribute-Flutter

Overview

This repo performs face auto-capture functionality on real-time mobile camera.
It also supports the following functionalities: face liveness detection, face recognition, pose estimation, face quality calculation, face landmark detection, face occlusion detection, eye closure detection, age/gender estimation.

In this repository, we integrated KBY-AI's face premium SDK into the Flutter project for both Android and iOS.

β—ΎFaceSDK(Mobile) Details

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

β—ΎFaceSDK(Mobile) Product List

No. Repository SDK Details
1 Face Liveness Detection - Android Basic SDK
2 Face Liveness Detection - iOS Basic SDK
3 Face Recognition - Android Standard SDK
4 Face Recognition - iOS Standard SDK
5 Face Recognition - Flutter Standard SDK
6 Face Recognition - Ionic-Cordova Standard SDK
7 Face Recognition - React-Native Standard SDK
8 Face Attribute - Android Premium SDK
9 Face Attribute - iOS Premium SDK
➑️ Face Attribute - Flutter Premium SDK

To get Face SDK(server), please visit products here.

Try with Demo App

Google Play

Screenshots

SDK License

To run this repo successfully, license should be required based on each application ID.

  • The code below shows how to use the license:

    if (Platform.isAndroid) {
    await _facesdkPlugin
    .setActivation(
    "uv4FFhzjRNjCS5HdY4JmdTB3Rxp15p1spg5Q+DWy+kjZk5ExrLyzBIzwPcwNfYPFAnTlQkq395oT"
    "3S6/WBAGP4keZbA+XZ5PRUn+43DG+y9aQKOU03RM2/bg6SdN1bRLW0Jfc56CCH0c6+7xqCoDRauH"
    "iPIJsFMjJQdjA64MM9uZDj1hdDOF5nCHj/9Lq8Or56inZY5POs5qo9Y4kJuIfIVTCbzLMQHwSo9B"
    "urvnJFUT9jtsIhbseAhZPrHfZGVCehCyYE9HSkXLok+omARw+VUnmBeDwbS+HBy4/7DqCotK5MMK"
    "QOp4XocTLg6Vx0PYOwMF4Wdw9LCjknYhRp3/Og==")
    .then((value) => facepluginState = value ?? -1);

  • To request a license, please contact us:
    πŸ§™Email: [email protected]
    πŸ§™Telegram: @kbyai
    πŸ§™WhatsApp: +19092802609
    πŸ§™Skype: live:.cid.66e2522354b1049b
    πŸ§™Facebook: https://www.facebook.com/KBYAI

How To Run

1. Flutter Setup

Make sure you have Flutter installed.
This repo has been built with Flutter version 3.22.3.
If you don't have Flutter installed, please follow the instructions provided in the official Flutter documentation here.

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.

About SDK

1. Setup

1.1 Setting Up Face SDK

Android

  • Copy the SDK (folder libfacesdk) to the folder android in your project.
  • Add SDK to the project in settings.gradle.
include ':libfacesdk'

1.2 Setting Up Face SDK Plugin

  • Copy the folder facesdk_plugin 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 Facesdk Plugin

  • 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 faces using the extractFaces method:
final faces = await _facesdkPlugin.extractFaces(image.path)
  • Calculate the 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

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 opening

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published