This template serves as a starting point for implementing a Camera and connecting it to a Native SDK, sending the results back to Flutter.
This project is associated with the article available at: Implementing Face Liveness Detection in Flutter with High Performance
Here's the VDO from the demo https://www.youtube.com/watch?v=kfFJI_ipdso
To use this template, follow these steps:
- Change
FaceLivenessDelegate.swift
: Implement your own callback or delegate from the SDK. Adjust the interface based on your SDK. FaceLivenessDetection.swift
: Add the initial setup for your ML to replace our initial SDK.FaceLivenessDetection.swift
: Add your ML processing here and replace it with our feeding logic.- You can change the camera resolution with this line:
captureSession.sessionPreset = .photo
. Currently, it's set to the maximum.
- Change
FaceLivenessListener.kt
and replaceYourSDKDelegate
with your callback. - Change
FaceLivenessDetection.kt
: Add the initial setup for your ML and your ML processing. - You can change the camera resolution at
ResolutionStrategy
on line 45. I added a parameter from Dart to adjust the resolution based on the controller from Flutter.
Please note that this template is not a one-size-fits-all solution, but it provides a solid starting point (around 70-80% completion). You will need to implement the remaining functionality and customize it to meet your specific requirements.
Enjoy coding!