人脸识别Android离线SDK常见问题和解答
置顶
littergang 发布于2018-08 浏览:57874 回复:87
3
收藏
最后编辑于27天前

1.咱们离线安卓sdk有没有windows的这个最多识别5个人脸的功能?

答:离线SDK不直接支持最多识别人数,有内部方法

2:同一台安卓设备程序更新 重新安装后,设备硬件指纹信息和原来的不一样了
导致同一个序列号 不能激活?

答:下载使用最新的SDK:版本变更1.0.1
1、修复设备指纹发生变化bug
2、替换近红外活体模型,优化效果
3、修复批量注册人脸到人脸库,失败问题
4、修复注册、图片人脸检测、视频返回图片抽取特征失败,经常出现检测不到人脸问题。

3.离线SDK,目前我使用的是离线激活的方式,按照步骤在序列号那里输入对应的硬件指纹,然后得到了license.zip这个授权文件,之后文档说:将该文件放到SDK指定位置即可,我完全不太明白你们说的"指定位置"是哪里?请问android版本的该如何操作?

答:android暂时不支持完全离线授权。

4:在demo里面,视频vs人脸库的特征抽取耗时与图片vs图片特征抽取耗时有差异,
视频流中提取耗时:500ms
图片当中提取耗时:700ms
请问是否符合预期呢?

答:图片提取包含了人脸检测的时间,视频流提取耗时应该只是特征提取的时间。

5:脸识别离线sdk可以识别其他平台人脸采集的信息吗
业务场景:Windows端拿到用户的一张人脸照片,Windows端对这张照片进行人脸采集和人脸注册的工作,接着Android端通过摄像头捕捉到人脸图片,调用在线API进行人脸识别比对的工作。这样子可以吗?

答:调在线的不行,目前发布的window和android可以互通。

6:人脸特征在windows端提取,建立人脸库,然后Android端可以进行人脸对比么?

答:是可以的。

7;示例中打开前置摄像头黑屏的,没有图像?

答:可以修改下代码:

8:人脸注册如果已经有这张人脸的数据就更新数据,不要重复添加,应该调用哪个方法?

答:

9.离线SDK,目前我使用的是离线激活的方式,按照步骤在序列号那里输入对应的硬件指纹,然后得到了license.zip这个授权文件,之后文档说:将该文件放到SDK指定位置即可,我完全不太明白你们说的"指定位置"是哪里?请问android版本的该如何操作?

答:android暂时不支持完全离线授权。

10.使用Android离线SDK,成功激活后,重装app后再输入序列号就报错license has actived on other device,是什么原因?

答:这个是由于硬件指纹变化导致的,目前已升级新版本1.0.1,。可以在官网下载最新的SDK,新的SDK激活不能使用以前旧的序列码激活,可以重新申请新的序列码重新激活设备。

11.在“人脸采集SDK”中,设置人脸回调
public void onDetectFace(final int retCode, FaceInfo[] infos, ImageFrame frame)
后infos里面是人脸的信息,我想 了解infos里面具体都有哪些信息?

答:

12.同一设备系统还原后再次激活离线sdk失败
一开发板硬件首次正常激活离线人脸识别sdk后,系统恢复出厂设置,离线sdk(永久、正式版)激活失败。
更新最新版 SDK也无法解决。换成sdk 1.0.1的人脸识别后,离线激活时,同一个设备原来的激活码用不了……显示已使用,该现象是否正常,应该如何处理?

答:这个是正常的,使用新的SDK后以前的序列码不能再使用,可以换个新的序列码重新激活。

13.离线的android-SDK
调用:getFeature接口
在使用Android-SDK时,对图片进行特征提取时,经常会出现特征提取失败的情况,错误码为6

答:应该是在人脸检测的过程中没有检测到人脸,建议调整设置下人脸的大小set_min_face_size的值。

14.TexturePreviewView我设置成match_parent 显示大小是1920*1080就可以,可是设置成指定大小320dp*180dp就显示不正确呢?预览大小还是setPreferredPreviewSize(640, 480);?

答:previewsize不是随便设置的,要是camera支持的才行,camera.getPreviewSize()确认下。

15.能解释下SDK参数配置的一些详细的说明吗?

答:

收藏
点赞
3
个赞
共87条回复 最后由烽小回复于27天前
#48宝驾网络公司回复于2019-04

Demo 能运行,移植到项目就报错!

 

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
at java.util.concurrent.ForkJoinTask.join(ForkJoinTask.java:720)
at java.util.ArrayList.forEach(ArrayList.java:1251)
at com.android.builder.dexing.DxDexArchiveMerger.mergeMultidex(DxDexArchiveMerger.java:266)
at com.android.builder.dexing.DxDexArchiveMerger.mergeDexArchives(DxDexArchiveMerger.java:133)
at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:97)
at com.android.build.gradle.internal.transforms.ExternalLibsMergerTransform.transform(ExternalLibsMergerTransform.kt:121)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
at sun.reflect.GeneratedMethodAccessor937.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:72)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
... 4 more
Caused by: com.android.dex.DexException: Multiple dex files define Lcom/baidu/idl/facesdk/FaceTracker;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
... 6 more

 

0
#47没心没肺de笑sc回复于2019-04
#41 yh23202回复
Process: com.pashanhu.pashanhueducationandroid:pushcore, PID: 14644 java.lang.NoSuchFieldError: no "J" field "index" in class "Lcom/baidu/idl/facesdk/FaceTracker;" or its superclasses at com.baidu.idl.facesdk.FaceTracker.create(Native Method) at com.baidu.idl.facesdk.FaceTracker.<init>(SourceFile:59) at com.baidu.idl.face.platform.c.d(SourceFile:47) at com.pashanhu.pashanhueducationandroid.app.App.onCreate(SourceFile:85) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1025) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5546) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1626) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:163) at android.app.ActivityThread.main(ActivityThread.java:6388) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:791) 打不了正式包,一点击就报这个错,请问各位该怎么混淆,百度里面没有相关介绍
展开

方便聊聊吗,咨询一下离线识别sdk的问题

0
#46Liudm880913回复于2019-03

一,armeabi架构下的so能不能提供下,性能差不要紧;二,targetSdkVersion=25能不能适配到26以上,不然还要对百度的sdk单独做兼容

0
#45dodododo2385回复于2019-03

03-25 10:36:32.853 22755-22755/com.dover.www.intelligentfuel W/SQLiteConnectionPool: The connection pool for database '/data/data/com.dover.www.intelligentfuel/databases/face.db' has been unable to grant a connection to thread 1 (main) with flags 0x6 for 1110.025 seconds.
Connections: 0 active, 1 idle, 0 available.
03-25 10:37:02.853 22755-22755/com.dover.www.intelligentfuel W/SQLiteConnectionPool: The connection pool for database '/data/data/com.dover.www.intelligentfuel/databases/face.db' has been unable to grant a connection to thread 1 (main) with flags 0x6 for 1140.025 seconds.
Connections: 0 active, 1 idle, 0 available.
03-25 10:37:32.853 22755-22755/com.dover.www.intelligentfuel W/SQLiteConnectionPool: The connection pool for database '/data/data/com.dover.www.intelligentfuel/databases/face.db' has been unable to grant a connection to thread 1 (main) with flags 0x6 for 1170.026 seconds.
Connections: 0 active, 1 idle, 0 available.
03-25 10:38:02.853 22755-22755/com.dover.www.intelligentfuel W/SQLiteConnectionPool: The connection pool for database '/data/data/com.dover.www.intelligentfuel/databases/face.db' has been unable to grant a connection to thread 1 (main) with flags 0x6 for 1200.0271 seconds.
Connections: 0 active, 1 idle, 0 available.

 

 

实在搞不明白2.0中的 DBManager 该咋用

0
#44smile坤坤star回复于2019-03

人脸识别获取的图片为啥是倾斜的

1
#43菜心傻猪猪回复于2019-03
#38 梅沙科技回复
移植DEMO后可以调试,打正式包就会报错。

我的也是,,  新的人脸DEMO打正式包报错

0
#42130******32回复于2019-03

Android 离线采集SDK,人脸识别(不是活体检测)采集到的图片有黑边和倾斜,请问解决了吗

2
#41yh23202回复于2019-03

Process: com.pashanhu.pashanhueducationandroid:pushcore, PID: 14644
java.lang.NoSuchFieldError: no "J" field "index" in class "Lcom/baidu/idl/facesdk/FaceTracker;" or its superclasses
at com.baidu.idl.facesdk.FaceTracker.create(Native Method)
at com.baidu.idl.facesdk.FaceTracker.(SourceFile:59)
at com.baidu.idl.face.platform.c.d(SourceFile:47)
at com.pashanhu.pashanhueducationandroid.app.App.onCreate(SourceFile:85)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1025)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5546)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1626)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6388)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:791)

打不了正式包,一点击就报这个错,请问各位该怎么混淆,百度里面没有相关介绍

0
#40156******90回复于2019-02
#39 156******90回复
你们都是什么版本的android studio啊,我这个3.0项目都没法跑起来各种错
展开

Android studio升级到3.3就好了

0
#39156******90回复于2019-02

你们都是什么版本的android studio啊,我这个3.0项目都没法跑起来各种错

0
#38梅沙科技回复于2019-02

移植DEMO后可以调试,打正式包就会报错。

1
#37我是小丸子774回复于2019-02
#26 瀞芷886回复
android下载的离线采集SDK   适配的so文件只有armeabi-v7a,v8和x86的,并没有armeabi的,是否不支持armeabi手机架构
展开

不支持,因为性能太低了没有必要

0
#36tempAccountAD回复于2019-02

启动黑屏已经解决了,是因为其他app占用摄像头导致人脸识别app启动黑屏

 

0
#35tempAccountAD回复于2019-02
#29 jessyuan24回复
设置cameraHandler延时postDelayed,500毫秒左右
展开

还是不行,延时了2秒,每次开机启动,都会黑屏,需要手动退出app重新打开就没问题,你那个问题是没有加载到library项目

0
#34130******16回复于2019-01

离线版的人脸库在损坏的设备上,能否移植到新的设备上???新的设备我重新申请.谢谢

0
#33renpingyangfly回复于2019-01

请官方将 android版的 “人脸通行示例代码”用android studio 3.3测试一下,再发布出来可以吗,谢谢,现在各种错,花了好多时间,头疼

0
#32renpingyangfly回复于2019-01

请官方把 android 版的“人脸通行示例代码”用android studio 3.3 编译一下发出来好吗, 现在各种错,花了大量时间去搞,头疼,谢谢了 

1
#31别哭亲爱的人啊回复于2019-01

获取人脸结果成功,但是用户id为空是什么原因?百度人脸库可以看到那个id。

0
#30琅琊榜plus回复于2019-01
#18 AIWOxxxOOO回复
 get_remote_license =https://aip.baidubce.com/public/2.0/license/face-api/app/querydevicelicense {"err_no":700,"err_msg":"wrong match of appkey\/packedge_name\/signature_md5","result":[],"timestamp":1545047155,"cached":0,"serverlogid":"6515201992500","error_code":700,"error_msg":"wrong match of appkey\/packedge_name\/signature_md5"}   这个有人出现过吗?求救!!!  
展开

您好,你这个解决没有了,卧槽我之前没出现,现在在一个手机上每次都出现

0
#29jessyuan24回复于2019-01
#21 tempAccountAD回复
预览摄像头黑屏怎么解决,app第一次启动就黑屏,再次启动一般都能正常预览摄像头.
展开

设置cameraHandler延时postDelayed,500毫秒左右

0
TOP
切换版块