我认为您需要了解使用人脸检测时可以使用的选项。
/** Libary Options */
val options = FirebaseVisionFaceDetectorOptions.Builder()
.setModeType(FirebaseVisionFaceDetectorOptions.ACCURATE_MODE) // used to state whether the recognition process should favour either speed or accuracy, can be set to either ACCURATE_MODE or FAST_MODE. This defaults to FAST_MODE.
.setLandmarkType(FirebaseVisionFaceDetectorOptions.ALL_LANDMARKS) // used to declare whether the recognition process should recognise facial landmarks such as the nose, eyes, mouth etc. This defaults to NO_LANDMARKS.
.setClassificationType(FirebaseVisionFaceDetectorOptions.ALL_CLASSIFICATIONS) // used to declare whether the recognition process should classify facial features such as whether the face is smiling or the eyes are open. This defaults to NO_CLASSIFICATIONS.
.setMinFaceSize(0.15f) //used to define the minimum size of a face (relative to the given image) for it to be detected. This value defaults to 0.1f.
.setTrackingEnabled(true) // used to declare whether or not an ID should be assigned to faces, for tracking faces between images. This defaults to false.
.build()
我举了一个例子,但是用西班牙语,或者如果你想了解更多关于这个图书馆的信息,请阅读这篇媒体文章。
https://medium.com/google-developer-experts/exploring-firebase-mlkit-on-android-face-detection-part-two-de7e307c52e0