This is the realtime face recognition flutter app using both Google ML Vision and TensorFlow Lite running well on both Android and iOS to utilize both ways in order to recognize face as fast as real-time. Tflite Model is being used in this app is "mobilefacenet.tflite".
Used Firebase Google ML Vision to detect faces. This is the ON-DEVICE ML vision tool of Google which means we either don't need any corresponding project on Firebase or JSON files.
Use mobilefacenet.tflite pretrained model along with tflite_flutter widget for this purpose.
Step 1: Download or clone this repo:
git clone https://github.com/ngtrphuong/facerecognition.git
Step 2: Go to project root and execute the following command in console to get the required dependencies:
flutter pub get
Step 3: Add/update library to ensure flutter app works well with iOS devvices
Firstly, we can always create flutter iOS cache via command " ** flutter precache --ios ** " in root directory of Flutter app
Secondly, go into ios directory via cd ios and perform command pod install to install all necessary libraries for iOS app
The last, as usual, open Runner.xcworkplace and configure required fields, parameters prior to running in either on Android Studio or in terminal as normal
Step 4: Install flutter app
flutter run
-
After successful "flutter pub get", remember go into ios, edit Podfile and add/uncomment platform line and put ít release to 12.0 or newer ( platform :ios, '12.0' ). This is the mandatory update to ensure this project runs well on iOS devices.
-
This FaceID works pretty well with Camera mode in "low" resolution while a bit of lag in other resolution modes. Please pay attention into this.
-
All flutter packages are latest up-to-date, recommend not to change anything with these packages in our production app.
This can be seen in below gif files (exactly these are what you can see with this app) -
-
Guidance on how to configure iOS Camera/Micro permissions request - https://pub.dev/packages/image_picker
-
Google ML Vision widget (Our Client mostly relies on this Widget) - https://pub.dev/packages/google_ml_vision