Animated_face_detection

Animated Face Detection

About   |   Features   |   Technologies   |   Requirements   |   Starting   |   License   |   Author


Buy Me A Book

Github Badge

:dart: About

Animated Face Detection is a Flutter package to facilitate integration with facial recognition.

:sparkles: Features

:heavy_check_mark: Face Recognition
:heavy_check_mark: Steps face detection;

:checkered_flag: Starting

Create a list of steps for facial recognition. These steps will be the animated steps that the end user will go through.

 final List<RecognitionStepItem> _veificationSteps = [];
_veificationSteps.addAll(
      [
        RecognitionStepItem(
          step: RecognitionStep.blink,
          title: "Pisque",
          isCompleted: false,
          detectionColor: Colors.amber,
        ),
        RecognitionStepItem(
          step: RecognitionStep.turnLeft,
          title: "Vire para a esquerda",
          isCompleted: false,
          detectionColor: Colors.amber,
        ),
        RecognitionStepItem(
          step: RecognitionStep.turnRight,
          title: "Vire para a direita",
          isCompleted: false,
          detectionColor: Colors.amber,
        ),
        RecognitionStepItem(
          step: RecognitionStep.smile,
          title: "Sorria",
          isCompleted: false,
          detectionColor: Colors.green.shade800,
        ),
      ],
    );

Call the configure function to initialize the package configurations, also passing the previously configured steps.

AnimatedFaceDetection.instance.configure(
      lineColor: Style.theme.white,
      dotColor: Style.theme.greenInformation,
      dotSize: 2.0,
      lineWidth: 2,
      dashValues: [2.0, 5.0],
      displayDots: false,
      displayLines: true,
      thresholds: [
        SmileDetectionThreshold(
          probability: 0.8,
        ),
        BlinkDetectionThreshold(
          leftEyeProbability: 0.25,
          rightEyeProbability: 0.25,
        ),
      ],
    );

Call the faceDetect function to navigate to the screen responsible for executing the entire recognition flow and at the end this same function will return the captured image data.

final CapturedImage? response = await AnimatedFaceDetection.instance.faceDetect(
      context,
      config: DetectionConfig(
        steps: _veificationSteps,
        startWithInfoScreen: true,
        showFacialVertices: false,
        maxSecToDetect: _timeOutDuration == 100 ? 2500 : _timeOutDuration,
        allowAfterMaxSec: _allowAfterTimeOut,
        captureButtonColor: Colors.red,
        textStartButtonFacePage: "Iniciar",
      ),
      style: DetectionStyle(
        backgroudMessageColor: Colors.white,
        textMessageColor: Colors.white,
        buttonTextColor: Colors.white,
        buttonColor: Style.theme.primaryColor,
        backgroundInfoPage: Colors.white,
        textColorInfo: Colors.black,
      ),
    );

:memo: License

This project is under license from BSD 3-Clause License. For more details, see the LICENSE file.


You can also buy me a cup of coffee

Projeto desenvolvidor por: Jhonathan Queiroz

Back to top