FaceDetectorHandle:母语脸检测尚未公布。还原到无操作检测 [英] FaceDetectorHandle﹕ Native face detector not yet available. Reverting to no-op detection

查看:827
本文介绍了FaceDetectorHandle:母语脸检测尚未公布。还原到无操作检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想纳入谷歌播放服务7.8 API脸在我的应用程序,但每次我试图侦测脸部的时候它给我的错误:

I'm trying to incorporate the Google Play Services 7.8 Face API in my app, but every time I try to detect faces it gives me the error:

FaceDetectorHandle:母语脸检测尚未公布。还原到无操作检测

FaceDetectorHandle﹕ Native face detector not yet available. Reverting to no-op detection

据帖子的Andr​​oid底部-er人脸检测,上运行的棒棒糖或更高版本的设备出现此问题。具体来说,他们说,它适用于一个红米手机2,运行Android 4.4.4与谷歌Play服务的版本99年8月7日安装,但不是在的Nexus 7 2012(没有前置摄像头)运行Android 5.1.1,与同谷歌播放服务版99年8月7日安装。它也不会在我一加手机运行5.0.2工作。有谁知道原因或修复?它最终将安装库和工作?

According to the bottom of the post Android-er Face Detection, this problem occurs on devices running Lollipop or later. Specifically, they said it works on a "RedMi 2, running Android 4.4.4 with Google Play services version 7.8.99 installed, but not on a Nexus 7 2012 (WITHOUT front camera) running Android 5.1.1, with the same Google Play services version 7.8.99 installed." It also doesn't work on my OnePlus One running 5.0.2. Does anyone know the cause or fix? Will it eventually install the library and work?

编辑:
这里有一些日志。我刚才复制的日志警告,周围使用了人脸检测时高,所以它可能不是所有的相关的。

Here are some logs. I just copied logs warning and higher around the time that the face detector was used, so it might not all be relevant.

08-19 17:29:17.828 W/ResourcesManager(25536): Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
08-19 17:29:17.828 W/ResourcesManager(25536): Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
08-19 17:29:17.908 W/FaceDetectorHandle(25536): Native face detector not yet available.  Reverting to no-op detection.
08-19 17:29:18.060 W/ResourcesManager(25536): Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
08-19 17:29:18.060 W/ResourcesManager(25536): Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
08-19 17:29:20.267 W/LatinIME( 1645): Deprecated private IME option specified: nm,com.google.android.inputmethod.latin.noGestureFloatingPreview
08-19 17:29:20.267 W/LatinIME( 1645): Use com.google.android.inputmethod.latin.noMicrophoneKey instead
08-19 17:29:20.294 E/EntSec  (  923): [QSB   ] [QSB_CLIENT ] No connection with the NQS
08-19 17:29:20.306 E/EntSec  (  923): [QSB   ] [QSB_CLIENT ] No connection with the NQS
08-19 17:29:20.317 E/EntSec  (  923): [QSB   ] [QSB_CLIENT ] No connection with the NQS
08-19 17:29:20.532 E/EntSec  (  923): [QSB   ] [QSB_CLIENT ] No connection with the NQS
08-19 17:29:20.655 W/OpenGLRenderer( 1814): Incorrectly called buildLayer on View: CoreSuggestionView, destroying layer...
08-19 17:29:20.655 W/OpenGLRenderer( 1814): Incorrectly called buildLayer on View: CoreSuggestionView, destroying layer...
08-19 17:29:20.655 W/OpenGLRenderer( 1814): Incorrectly called buildLayer on View: CoreSuggestionView, destroying layer...
08-19 17:29:20.655 W/OpenGLRenderer( 1814): Incorrectly called buildLayer on View: NowProgressBar, destroying layer...
08-19 17:29:20.655 W/OpenGLRenderer( 1814): Incorrectly called buildLayer on View: CrossfadingWebImageView, destroying layer...
08-19 17:29:20.655 W/OpenGLRenderer( 1814): Incorrectly called buildLayer on View: ew, destroying layer...
08-19 17:29:20.912 W/LatinIME( 1645): Deprecated private IME option specified: nm,com.google.android.inputmethod.latin.noGestureFloatingPreview
08-19 17:29:20.912 W/LatinIME( 1645): Use com.google.android.inputmethod.latin.noMicrophoneKey instead
08-19 17:29:20.924 E/EntSec  (  923): [QSB   ] [QSB_CLIENT ] No connection with the NQS
08-19 17:29:20.934 W/Search.SearchUrlHelper( 1969): URL param or header with a key: "oq" has an empty value.
08-19 17:29:20.941 E/EntSec  (  923): [QSB   ] [QSB_CLIENT ] No connection with the NQS
08-19 17:29:20.956 E/EntSec  (  923): [QSB   ] [QSB_CLIENT ] No connection with the NQS
08-19 17:29:21.038 W/IInputConnectionWrapper( 1814): performPrivateCommand on inactive InputConnection
08-19 17:29:21.085 W/BindingManager( 1969): Cannot call determinedVisibility() - never saw a connection for the pid: 1969
08-19 17:29:21.764 W/VelvetPresenter( 1969): Still observing while not the active client
08-19 17:29:21.765 W/VelvetPresenter( 1969): Still observing while not the active client
08-19 17:29:22.067 W/BindingManager( 1969): Cannot call determinedVisibility() - never saw a connection for the pid: 1969
08-19 17:29:22.250 W/WebViewRenderState( 1969): resultsPageEnd: not current commit, new=27, committed=0
08-19 17:29:22.344 W/SurfaceFlinger(  243): couldn't log to binary event log: overflow.
08-19 17:29:22.371 W/OpenGLRenderer( 1814): Incorrectly called buildLayer on View: ew, destroying layer...
08-19 17:29:22.462 E/WebViewWorkerImpl( 1969): onShowedSrp: No SearchResult found being shown in WebView.
08-19 17:29:26.635 W/FaceDetector(25536): FaceDetector was not released with FaceDetector.release()


推荐答案

这脸检测功能的第一次是设备上运行时,它是必要的面部检测库下载到设备。 本土脸检测尚未公布。消息表明库尚未被下载。

The first time that face detection functionality is run on a device, it is necessary to download a face detection library to the device. The "Native face detector not yet available." message indicates that the library has not yet been downloaded.

它的建议,该移动视觉依赖被添加到的Andr​​oidManifest.xml。在安装应用程序时,这会主动要求库下载。请参见本说明文档:

It's recommended that the mobile vision dependencies are added to the AndroidManifest.xml. This will proactively request the library download when the app is installed. See this note in the docs:

添加视觉依赖于Android清单

添加视觉功能依赖于你的项目
  的Andr​​oidManifest.xml将指示安装,它应
  下载应用程序上安装时的依赖。尽管这不是
  严格要求,它可以让用户体验更好,当
  最初运行你的应用程序。例如,加入以​​下
  AndroidManifest.xml中(在应用程序部分)将指示
  无论是酒吧code和人脸检测的依赖应该下载
  在应用程序安装时间:

Adding the vision functionality dependency to your project's AndroidManifest.xml will indicate to the installer that it should download the dependency on app install time. Although this is not strictly required, it can make the user experience better when initially running your app. For example, adding the following to AndroidManifest.xml (in the application section) will indicate that both the barcode and face detection dependencies should be downloaded at app install time:

<元数据机器人:名字=com.google.android.gms.vision.DEPENDENCIES
                机器人:值=酒吧code,面>

<meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,face">

有效的愿景依赖值为:酒吧code或面

Valid vision dependency values are: barcode or face

然而,即使这被提供时,在某些情况下
  运行探测器所需的依赖关系可以按需下载
  当你的应用程序运行的第一次,而不是在安装时。
  见isOperational()和detectorIsOperational()了解更多信息
  对在检查你的应用程序的依赖下载状态。

However, even if this is supplied, in some cases the dependencies required to run the detectors may be downloaded on demand when your app is run for the first time rather than at install time. See isOperational() and detectorIsOperational() for more information on checking the dependency download status in your app.

如上所示,你的应用程序可以检查此与isOperational()方法:

As indicated above, your app can check for this with the isOperational() method:

<一个href=\"https://developers.google.com/android/reference/com/google/android/gms/vision/face/FaceDetector.html#isOperational()\" rel=\"nofollow\">https://developers.google.com/android/reference/com/google/android/gms/vision/face/FaceDetector.html#isOperational()

该探测器将尝试下载,而你的应用程序正在运行库,一旦已获得的库会自动开始运作。

The detector will try to download the libraries while your app is running, and will automatically become operational once the libraries have been obtained.

但是,在某些情况下,下载可能不会成功(例如,如果该设备不具有足够的自由存储空间,或者如果设备没有连接到网络)。尝试的第一件事将腾出更多的存储空间。

But in some cases the download might not succeed (e.g., if the device does not have sufficient free storage space, or if the device isn't connected to the network). The first thing to try would be freeing up more storage space.

调用发布()

在日志下面的警告表明一个不同的问题:

The following warning from the log indicates a different issue:

W/FaceDetector(25536): FaceDetector was not released with FaceDetector.release()

您的应用程序应该调用探测器(或摄像机源)上发布()方法时,它不再需要它。这将释放资源。虽然这是不相关的下载问题,这是很好的,一般做。例如,如果探测器在一次活动创造,这是很好的释放资源中的onDestroy():

Your app should call the release() method on the detector (or camera source) when it no longer needs it. This will free up resources. Although this isn't related to the download issue, it is good to do in general. For example, if the detector was created in an activity, it's good to release that resource in onDestroy():

protected void onDestroy() {
    super.onDestroy();
    mCameraSource.release();
}

这篇关于FaceDetectorHandle:母语脸检测尚未公布。还原到无操作检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆