简体   繁体   中英

Can I use ML kit Face detection to tell if the photo contains a face or not?

This sounds simple enough, But I can't see any attributes I can use from the returned information. I need to go through a list of photos, and for each decide if it contains a face or not. Using Firebase's ML kit, I see I can get back information about things like the angle of the head, or the probability of the face smiling, or the eyes being open. But what I need is much simpler. I just need to know if a face exists in the photo or not?

I can check for all the probabilities being 0 maybe and by that figure that there's no face in the photo, but I don't like that approach. Any ideas? I'll be happy to know if there's a different library you'd might recommend for that. I am doing this for a school project, so I need a free solution.

  • I need this to work for image files. I don't need to use it with a live camera view.

Ok, so I realized that the return value after a successful detection is a list of all the faces found in the image. A simple check for the size of the list would imply whether there are any faces in it (size is bigger than 0) or not (size is 0).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM