android人脸检测开发——使用GMV API(google mobile vision library)开发人脸检测功能

授人以鱼不如授人以渔:建议看以下官网资料!

注意事项:

一、人脸检测库下载失败问题

初次安装人脸检测APP时要从google官网下载相应库,由于国内无法访问google,

因此会导致无法下载库,导致无法检测出人脸。

几种方法可以试试:

  1. 翻墙,目前还没有行通。
  2. 手机上是否需要安装google play service?待确定

The first time that an app using the Face API is installed on a device, GMS will download a native library to the device in order to do face detection.

Usually this is done by the installer before the app is run for the first time.

But if that download has not yet completed, then the above “detect” method will not detect any faces.

导致无法下载人脸检测库的几种原因:无法连接到google,或手机内存空间不足。

This could happen if the user is not online, if the user lacks sufficient storage space on their device, or if the download is otherwise delayed (e.g., due to a slow network).

The detector will automatically become operational once the library download has been completed on device.

A detector’s isOperational method can be used to check if the required native library is currently available:

通过isOperational属性来判断人脸检测库是否下载成功,示例代码:

二、库停止维护,转移到ML上的问题

GMV作为一个独立库已经停止维护,被加入到了Firebase的ML机器学习库中。

The Mobile Vision API is now a part of ML Kit. We strongly encourage you to try it out, as it comes with new capabilities like on-device image labeling! Also, note that we ultimately plan to wind down the Mobile Vision API, with all new on-device ML capabilities released via ML Kit. Feel free to reach out to Firebase support for help.

猜你喜欢

转载自blog.csdn.net/qq_18276949/article/details/106229221