android - Android 的 Firebase ML Kit 人脸检测速度慢

标签 android firebase performance firebase-mlkit google-mlkit

我想从图库图像(位图)中检测人脸。

问题

  1. 我注意到 Firebase MLKIT 在 Gallery 上的执行速度非常慢 图像位图。
  2. 我还能使用移动视觉 api 检测图像中的人脸吗?(我只想检测人脸,不需要眼睛、 Nose 等)
  3. 我应该怎么做才能提高使用 Firebase MLKIT 检测人脸的性能。
  4. 我使用了 Firebase 图像标签。 Firebase 图像标记执行速度很快,但人脸检测相对来说非常慢。

我尝试使用 Mobile vision Api 并成功检测到人脸。在移动视觉 api 的网站上,他们提到了 Firebase MLKIT。 我还尝试了 firebase ML Kit 并成功检测到人脸。我点击了这个链接进行演示: [ https://github.com/hitanshu-dhawan/FirebaseMLKit]

库版本:

implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-ml-vision:22.0.0'
implementation 'com.google.firebase:firebase-ml-vision-face-model:18.0.0'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:18.0.0' 

    FirebaseVisionFaceDetectorOptions option =
     new FirebaseVisionFaceDetectorOptions.Builder()
    .setPerformanceMode(FirebaseVisionFaceDetectorOptions.ACCURATE)
    .setLandmarkMode(FirebaseVisionFaceDetectorOptions.ALL_LANDMARKS)
    .setClassificationMode(FirebaseVisionFaceDetectorOptions.ALL_CLASSIFICATIONS)
    .build();

    FirebaseVisionFaceDetector detector = FirebaseVision.getInstance()
                .getVisionFaceDetector(option);

        detector.detectInImage(image).addOnSuccessListener(
                new OnSuccessListener<List<FirebaseVisionFace>>() {
                    @Override
                    public void onSuccess(List<FirebaseVisionFace> faces) {
    }

我做错了什么吗?

最佳答案

我觉得你可以改变 .setPerformanceMode(FirebaseVisionFaceDetectorOptions.ACCURATE).setPerformanceMode(FirebaseVisionFaceDetectorOptions.FAST)

可能会提高检测速度

关于android - Android 的 Firebase ML Kit 人脸检测速度慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57551321/

相关文章:

android - 什么时候触摸 AlertDialog 之外的屏幕会取消 AlertDialog?

android - 在 Android 中实现应用内购买?

android - 如何使用 CookieStore 获取 HttpUrlConnection 中的 cookie?

java - 如何停止在android中的 Activity 应用程序窗口中显示应用程序

ios - 如何在 firebase (swift) 中获取子节点的值,并将其显示在 View Controller 的标签中

ios - 你如何制作一个必须对 firebase 数据库进行查询并将查询值作为 int 返回的函数?

firebase - 新Firestore的限制说明

java - 哪个代码更有效?为什么?

python - 在python中对大量数组进行排序的最快方法

performance - 提高 RadGrid 客户端性能