3

I could not find any function to count different people faces in 1 video real time. I want to detect head rotation but if there are 2 people, the getHeadEulerAngleY will detect the person in the background whose head is moving.

This is my detector option code:

FaceDetectorOptions detectorOptions = new FaceDetectorOptions
    .Builder()
    .setPerformanceMode(FaceDetectorOptions.PERFORMANCE_MODE_FAST)
    .setLandmarkMode(FaceDetectorOptions.LANDMARK_MODE_ALL)
    .build();

Also, Is it possible to count how many people in live detection?

tobi1805
  • 171
  • 10
K.Sopheak
  • 22,904
  • 4
  • 33
  • 78

1 Answers1

0

It seems there is no easy solution by only using ML Kit face detection. I wonder whether you can combine ML Kit object detection and ML Kit face detection.

Firstly using ML Kit object detection to detect and track object, it has object id & bounding box, and you can use ML Kit face detection to check whether it has face inside.

Once the targeted face is confirmed, use that track id then you can continuously get the bounding box of that face. Then you can crop that area out and use ML Kit face detection for head rotation.

jack
  • 125
  • 1
  • 9