我们开发了一个库,其中包括使用Android移动视觉API来检测用户的脸。以下问题仅出现在联想标签E7和Billow X703上。
private void createCameraSource() {
Context context = getApplicationContext();
FaceDetector detector = new FaceDetector.Builder(context)
.setProminentFaceOnly(true)
.setTrackingEnabled(true)
.setClassificationType(com.google.android.gms.vision.face.FaceDetector.ALL_CLASSIFICATIONS)
.setMode(com.google.android.gms.vision.face.FaceDetector.ACCURATE_MODE)
.setMinFaceSize(minFaceSize)
.build(); // <--- HERE IS THE EXCEPTION
detector.setProcessor(
new MultiProcessor.Builder<>(new GraphicFaceTrackerFactory())
.build());
if (!detector.isOperational()) {
// Note: The first time that an app using face API is installed on a device, GMS will
// download a native library to the device in order to do detection. Usually this
// completes before the app is run for the first time. But if that download has not yet
// completed, then the above call will not detect any faces.
//
// isOperational() can be used to check if the required native library is currently
// available. The detector will automatically become operational once the library
// download completes on device.
Log.w(TAG, "Face detector dependencies are not yet available.");
// Check for low storage. If there is low storage, the native library will not be
// downloaded, so detection will not become operational.
IntentFilter lowstorageFilter = new IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW);
boolean hasLowStorage = registerReceiver(null, lowstorageFilter) != null;
if (hasLowStorage) {
Toast.makeText(this, R.string.low_storage_error, Toast.LENGTH_LONG).show();
Log.w(TAG, getString(R.string.low_storage_error));
}
}
mCameraSource = new CameraSource.Builder(context, detector)
.setFacing(CameraSource.CAMERA_FACING_FRONT)
.setRequestedFps(fps)
.build();
}
当它即将构建人脸检测器时,会发生异常(见下文)。接下来,代码检查检测器是否返回false。例外情况如下:
2019-05-22 16:09:48.128 27557-27557/com.xxx.xxx.xxx W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite.face not found.
2019-05-22 16:09:48.134 25402-25415/? W/ProviderHelper: Unknown dynamite feature vision.dynamite.face
2019-05-22 16:09:48.140 27557-27557/com.xxx.xxx.xxx I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite.face:0 and remote module com.google.android.gms.vision.dynamite.face:0
2019-05-22 16:09:48.140 27557-27557/com.xxx.xxx.xxx D/FaceNativeHandle: Cannot load feature, fall back to load whole module.
2019-05-22 16:09:48.142 27557-27557/com.xxx.xxx.xxx W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.
2019-05-22 16:09:48.144 25402-25415/? W/ProviderHelper: Unknown dynamite feature vision.dynamite
2019-05-22 16:09:48.149 27557-27557/com.xxx.xxx.xxx I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:0
2019-05-22 16:09:48.154 27557-27557/com.xxx.xxx.xxx E/FaceNativeHandle: Error Loading module
com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
at com.google.android.gms.dynamite.DynamiteModule.load(Unknown Source:8)
at com.google.android.gms.internal.vision.zzm.zzq(Unknown Source:28)
at com.google.android.gms.vision.face.internal.client.zzc.<init>(Unknown Source:3)
at com.google.android.gms.vision.face.FaceDetector$Builder.build(Unknown Source:40)
at com.xxx.xxx.xxx.activities.Activity1.createCameraSource(Activity1.java:128)
at com.xxx.xxx.xxx.activities.Activity1.onCreate(Activity1.java:111)
at android.app.Activity.performCreate(Activity.java:7023)
at android.app.Activity.performCreate(Activity.java:7014)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2758)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2883)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
2019-05-22 16:09:48.154 27557-27557/com.xxx.xxx.xxx W/FaceNativeHandle: Native handle not yet available. Reverting to no-op handle.
在手机上安装应用程序后,Androidanifest.xml中的一行应通知移动应用程序为特定设备下载适当的人脸检测库。然而,这似乎仅在设备重置为出厂设置和首次安装应用程序时发生。例如,如果我通过Android Studio重新安装应用程序,则应用程序无法找到特定模块。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.xxx.xxx"
android:installLocation="auto">
<uses-permission
android:name="android.permission.INTERNET"
android:required="true" />
<uses-permission-sdk-23
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:required="true" />
<uses-permission-sdk-23
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:required="true" />
<uses-permission
android:name="android.permission.CAMERA"
android:required="true" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.front" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
android:allowBackup="true"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="face" />
<activity
android:name=".activities.Activity1"
android:screenOrientation="portrait" />
<activity
android:name=".activities.Activity2"
android:screenOrientation="portrait" />
<activity
android:name=".activities.Activity3"
android:screenOrientation="portrait" />
</application>
</manifest>
我们正在使用Google Play服务17.0.2
implementation 'com.google.android.gms:play-services-vision:17.0.2'
我们已经检查并尝试了以下操作:
该库在任何情况下都可以在其他设备上正常工作。在上述设备上,它只在应用程序在出厂重置后第一次部署时起作用。
我在使用华为P30 pro,也遇到了同样的问题。在尝试了互联网上找到的所有方法后,发现问题是由谷歌Play服务版本不更新引起的。Google Play Services版本为20.18.17,应用程序无法找到Android Vision模块,但在将其更新到版本20.36.15后,它成功了!
我使用tkinter制作了一个简单的Python[3.5.2]程序。当我在上面使用PyInstaller[3.2]时,它会给我一大堆'lib not found'警告。示例: 3218警告:找不到lib:api-ms-win-crt-runtime-l1-1-0.dll依赖项C:\python\vcruntime140.dll 3312警告:找不到lib:api-ms-win-crt-conver
当我运行我的Android应用程序从eclipse,我得到这个错误。 从日蚀错误复制粘贴 然而,我的亚洲开发银行就在它说的不在的地方。 出了什么问题,如何解决? 我将cd放入adb所在的目录()中,输入adb并显示 adb是绿色的,这意味着它是可执行的,对吗? 例如,dx也是绿色的,当我在命令提示符中输入dx时,它工作了... adb怎么了?
块引号 J拥有一个包含maven父项目(parent)和子项目(Domain,Web,Win)的Eclipse工作区。父pom包含wicket-spring-boot-starter-parent
当我尝试使用或出现以下错误 JAVA错误:sun。安全ssl。SSLSessionImpl。(Lsun/security/ssl/ProtocolVersion;Lsun/security/ssl/CipherSuite;Ljava/util/Collection;Lsun/security/ssl/SessionId;Ljava/lang/String;I)V 在sun.security.ssl
问题内容: 通过扫描程序读取文件时,程序中出现运行时异常。 我的代码是: 问题答案: 与你需要检查,如果存在与下一行 所以循环变成 是读者返回null 当然在这段代码中,这取决于输入的格式是否正确
我是新的Python开发和尝试使用pipenv。我运行命令,它成功运行: 然而,当我在一个新的根项目目录中运行命令时,我收到以下消息:。我怀疑我可能需要修改我的. bashrc,但是我不清楚要向文件中添加什么,或者是否需要修改。
我用Android Studio为Unity做了一个jar插件。我的插件使用。但找不到该类。Unity的控制台向我显示了以下错误:
我不知道如何处理以下错误,我已经搜索了网络,但没有找到任何东西: 以及: 我在gradle应用程序中的依赖项: