Building a face detector and detecting facial gestures
This recipe will explore ML Kit’s face detection. This also includes a model that predicts the probability of a face smiling or having open or closed eyes. This API also includes the identification of key facial features (such as eyes, nose, and mouth) and can get the contours of detected faces.
Getting ready
Before following this recipe, you should have completed the Using the device camera and Recognizing Text from an image recipes in this chapter.
How to do it...
In this recipe, you will add the face detection feature to the existing project: the model will predict whether the faces in the picture are smiling and have their eyes open. Follow these steps:
- Add the
google
_mlkit_face_detection
package to your project from the Terminal:flutter pub add google_mlkit_face_detection
- In the
ml.dart
file, import the face detection library:import 'package:google_mlkit_face_detection...