Support multiple face contours
Describe your environment
- Android device: Xiaomi Mi4c and Samsung S9
- Android OS version: 7.1.1 and 9.0
- Google Play Services version: 14.7.99
- Firebase/Play Services SDK version: firebase-core:16.0.6, firebase-ml-vision:18.0.2, firebase-ml-vision-face-model:17.0.2
Describe the problem:
I'm using Face Detection ml kit library to detect face contour and its lips. So I'm using this configuration:
val options = FirebaseVisionFaceDetectorOptions.Builder()
.setMinFaceSize(0.15f)
.setPerformanceMode(FirebaseVisionFaceDetectorOptions.ACCURATE) // I need more then 1 face
.setContourMode(FirebaseVisionFaceDetectorOptions.ALL_CONTOURS) // I need contours of faces
.enableTracking()
.setLandmarkMode(FirebaseVisionFaceDetectorOptions.NO_LANDMARKS)
.setClassificationMode(FirebaseVisionFaceDetectorOptions.NO_CLASSIFICATIONS)
.build()
I'm able to get more then 1 face (3 in my example image) with boundingBox and trackingId, but countours are populated only for one face. All others are just empty.
Documentation says that ALL_CONTOURS: Detects FirebaseVisionFaceContour for a given face. Note that it would return contours for up to 5 faces. So I expect that ml kit will return contours for up to 5 faces, but not the only 1 of them.
Steps to reproduce:
- Setup Ml Kit and sdk with configuration above
- Process an image or camera frame with multiply faces
- See face detection result
Observed Results:
- There are more then 1 face in result (3 in my case of image). But contours are populated only for one face in the result (for others just an empty lists).
Expected Results:
- Want to get up to 5 faces contours as it is said in the documentation.
This issue does not seem to follow the issue template. Make sure you provide all the required information.
I'm also only getting a single face's contours per analysis.
Perhaps the documentation for ALL_CONTOURS is incorrect. On the "Detect Faces with ML Kit on Android" quickstart page it says under "Detect contours" that "Contours are detected for only the most prominent face in an image."
temporary solution :
Same here. I'm detecting 5 faces but I'm only getting one face that has a contour. So, each time, I crop the picture on the faces for which the API can not detect its contour, I pass them to the API one by one, and there I can get the contour of each face. It's bad but it's working
i am also facing the same problem using firebase ml kit. Detecting multiple faces in the image but contours of only the most prominent face in the image. Anyone plzzzz help me!
Facing the same issue... any solution for it????
also check the discription:

I believe the current API only supports the contour for ONE face. I'll mark this as a feature request for now. Thanks!
Hi all,
Please try new Face mesh detection SDK, which has improved functionality for face contour
- It provides 468 3D points, rather than 133 2D points
- It provides face mesh for at most 2 faces.(Please let us know if you need to support more faces, we might consider it in future)
Thanks