mlkit icon indicating copy to clipboard operation
mlkit copied to clipboard

Support multiple face contours

Open mig35 opened this issue 6 years ago • 6 comments

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:

  1. Setup Ml Kit and sdk with configuration above
  2. Process an image or camera frame with multiply faces
  3. 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.

mig35 avatar Jan 29 '19 08:01 mig35

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Jan 29 '19 08:01 google-oss-bot

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."

marshallaf avatar Jun 06 '19 16:06 marshallaf

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

OmarBenyahyaten avatar Jun 26 '19 16:06 OmarBenyahyaten

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!

usmanali45 avatar Jul 28 '19 14:07 usmanali45

Facing the same issue... any solution for it???? also check the discription: image

AliAzaz avatar Nov 21 '19 21:11 AliAzaz

I believe the current API only supports the contour for ONE face. I'll mark this as a feature request for now. Thanks!

calren avatar Jul 20 '20 18:07 calren

Hi all,

Please try new Face mesh detection SDK, which has improved functionality for face contour

  1. It provides 468 3D points, rather than 133 2D points
  2. 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

jackqdyulei avatar Sep 27 '22 22:09 jackqdyulei