I have an Android application which makes use of Google ML Kit for detecting faces over frames taken by CameraX. My application is really simple, and uses the snippet below.
override fun analyze(image: ImageProxy) {
detector.process(image)
.addOnSuccessListener { faces ->
...
}
.addOnFailureListener { e ->
...
}
.addOnCompleteListener {
...
}
}
I would need to collect all faces on that frame along with their confidence value, because I want to be sure the detection has a good accuracy.
According with the picture below, the Face
object does not have any confidence value.
you are right. there is no confidence score result exposed in API surface for FaceDetector. However, the face result is only returned if the confidence is >= 0.5 so it should be safe to use.