当前位置:网站首页>【HMS core】【ML Kit】机器学习服务常见问题FAQ(二)
【HMS core】【ML Kit】机器学习服务常见问题FAQ(二)
2022-07-30 17:43:00 【华为开发者论坛】
1、文本识别服务
1.1、OCR打包后引入的证书问题
问题描述:
项目中依赖的SDK如下:
// 引入基础SDKapi "com.huawei.hms:ml-computer-vision-ocr:3.3.0.301"// 引入中英文文字识别模型包api "com.huawei.hms:ml-computer-vision-ocr-cn-model:3.3.0.301"问题:引入端侧OCR识别,不使用云侧版本,当App打包完成之后,assets目录下会有多个证书,这些证书是用来做什么的,请说明如下五个证书的用途?

问题解答:
hmsrootcas.bks
updataesdkcas.bks
hmsincas.bks
grs_sp.bks
这些bks文件主要作用为资格验证和鉴权
ag_sdk_cbg_root.cer
证书被暴露作为公钥的预置,主要用于验签华为应用市场的合法性,这些证书没有安全风险,可以放心使用。
2、实时语音识别服务
2.1、asr中英文非华为手机是否可用
问题描述:
- 目前法语、西班牙语、德语、意大利语、阿拉伯语、俄语、泰语、马来语、菲律宾语实时语音识别服务仅支持华为手机和荣耀手机使用,中英文实时语音识别服务支持所有品牌手机。
实时语音识别服务查看文档,其中中英文识别支持非华为手机,但是在服务价格文档里,如下图所示:

这里的意思是说华为手机免费,非华为手机收费吗?想确认以下几点:非华为手机是否可用,是否收费,美国是否可用?
问题解答:
Q:非华为手机是否可用?
A:中英文支持非华为手机。
Q:非华为手机是否收费?
A:免费。
Q:美国是否可用?
A:美国在支持的国家/地区,可用。
2.2、asr集成报错问题
问题描述:
环境: Unity2019.4.9f1导出的android Studio 工程
Android Gradle Plugin Version : 3.4.3
Gradle Version : 6.8
agconnect-services.json 文件放置于AS工程根目录中
[build.gradle(Project:Build)] 文件内容:
allprojects { buildscript { repositories { google() jcenter() // 配置HMS Core SDK的Maven仓地址。 maven {url 'https://developer.huawei.com/repo/'} flatDir { dirs 'libs' } } dependencies { classpath 'com.android.tools.build:gradle:3.4.3' classpath 'com.huawei.agconnect:agcp:1.6.5.300' } } repositories { google() jcenter() flatDir { dirs "${project(':unityLibrary').projectDir}/libs" } maven { url "https://developer.huawei.com/repo/" } }}task clean(type: Delete) { delete rootProject.buildDir}[build.gradle(Module: Build.launcher)] 文件内容:
apply plugin: 'com.android.application'apply plugin: 'com.huawei.agconnect'dependencies { implementation project(':unityLibrary') }android { compileSdkVersion 32 buildToolsVersion '32.0.0' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { minSdkVersion 24 targetSdkVersion 32 applicationId 'com.xxxxxxxxxxxxxxx' ndk { abiFilters 'armeabi-v7a', 'arm64-v8a' } versionCode 1 versionName '1.00' } aaptOptions { noCompress = ['.tflite', '.unity3d', '.ress', '.resource', '.obb', 'html/privacy_policy.html', 'html/user_agreement.html'] ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" } lintOptions { abortOnError false } buildTypes { debug { minifyEnabled false useProguard false proguardFiles getDefaultProguardFile('proguard-android.txt') signingConfig signingConfigs.debug jniDebuggable true } release { minifyEnabled false useProguard false proguardFiles getDefaultProguardFile('proguard-android.txt') signingConfig signingConfigs.debug } } packagingOptions { doNotStrip '*/armeabi-v7a/*.so' doNotStrip '*/arm64-v8a/*.so' } bundle { language { enableSplit = false } density { enableSplit = false } abi { enableSplit = true } } ndkVersion '21.3.6528147'}[build.gradle(Module: Build.unityLibrary)] 文件内容:
apply plugin: 'com.android.library'dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation(name: 'alphabet-release', ext:'aar') implementation(name: 'android-gif-drawable-1.2.6', ext:'aar') implementation(name: 'AndroidPermissionManager', ext:'aar') implementation(name: 'arcore_client', ext:'aar') implementation(name: 'HUAWEI AR Engine Plugin_Required', ext:'aar') implementation(name: 'HUAWEI AR Engine SDK_v2.11.0', ext:'aar') implementation(name: 'HUAWEI_AR_Engine_UnityPlugin', ext:'aar') implementation(name: 'NatCorder', ext:'aar') implementation(name: 'NatRender', ext:'aar') implementation(name: 'ocr-release', ext:'aar') implementation(name: 'open_ad_sdk', ext:'aar') implementation(name: 'unityandroidpermissions', ext:'aar') implementation(name: 'UnityARCore', ext:'aar') implementation(name: 'UniWebView', ext:'aar') implementation(name: 'voice-release', ext:'aar') implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.31' implementation 'androidx.browser:browser:1.2.0' implementation 'org.tensorflow:tensorflow-lite:2.4.0' implementation 'org.tensorflow:tensorflow-lite-gpu:2.4.0' implementation 'com.squareup.okhttp3:okhttp:3.12.1' // classification implementation 'com.huawei.hms:ml-computer-vision-classification:3.4.0.304' implementation 'com.huawei.hms:ml-computer-vision-image-classification-model:3.4.0.304' // object detection implementation 'com.huawei.hms:ml-computer-vision-object-detection-model:3.4.0.300' // OCR implementation 'com.huawei.hms:ml-computer-vision-ocr:3.4.0.301' implementation 'com.huawei.hms:ml-computer-vision-ocr-cn-model:3.4.0.301' // Automatic speech recognition SDK. implementation 'com.huawei.hms:ml-computer-voice-asr:3.4.0.302' // Automatic speech recognition plugin. implementation 'com.huawei.hms:ml-computer-voice-asr-plugin:3.4.0.302' // Automatic speech recognition Long voice SDK. implementation 'com.huawei.hms:ml-computer-voice-realtimetranscription:3.4.0.302' //implementation 'com.huawei.hms:hianalytics:6.4.0.300'}android { compileSdkVersion 32 buildToolsVersion '32.0.0' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { minSdkVersion 24 targetSdkVersion 32 ndk { abiFilters 'armeabi-v7a', 'arm64-v8a' } versionCode 1 versionName '1.00' consumerProguardFiles 'proguard-unity.txt' } lintOptions { abortOnError false } aaptOptions { ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" } packagingOptions { doNotStrip '*/armeabi-v7a/*.so' doNotStrip '*/arm64-v8a/*.so' } ndkVersion '21.3.6528147'}ASR错误Log信息:
2022-04-15 09:49:40.076 28731-29252/com.xxxxxxxx I/HaLogExecutor: type 1 mapValue:{package=com.xxxxxxxxx, appid=com.xxxxxxx, appName=xxxxx, version=ml-computer-voice-asr:3.4.0.302, service=MLKit, transId=65649995-1848-4baf-8c4f-03ad9b00cfbd, operator=46000, networkType=wifi, apkVersion=, apiName=, countryCode=CN, deviceType=TAS-AL00, emuiVersion=EmotionUI_12.0.0, moduleName=MLKitAsr, moduleVersion=3.4.0.302, deviceCategory=, applanguage=zh, speechStartTime=1649987379713, speechEndTime=, firstWordCost=, lastWordCost=, voiceStreamTime=, uploadVoiceSize=, textLength=, chainBuildingDelay=, result=40, resultDetail=[403002]Service unavailable}
2022-04-15 09:49:40.077 28731-28731/com.xxxxxxxxxx E/VoiceUtils: SpeechRecognitionListener::onError: ,subError code: 3002,errorMessage: Service unavailable
OCR错误Log信息为:
VoiceUtils: SpeechRecognitionListener::onError: ,subError code: 3002,errorMessage: Service unavailable
OcrUtils: [Failure]Incorrect parameter. This exception is irrelevant to services.
之前使用Unity2019.2.4f1导出AS工程,只有一个build.gradle, 在此环境中功能正常,现在使用的是Unity2019.4.9f1会报以上错误。
问题解答:
将agconnect-services.json配置文件放到应用的根目录下,不是整个工程的根目录下,如下图所示:

OK,今天的内容就这么多!
欲了解更多更全技术文章,欢迎访问https://developer.huawei.com/consumer/cn/forum/?ha_source=zzh
边栏推荐
- Insert data into MySQL in C language
- 首发!阿里技术大牛最新耗时半个月整理出最全MySQL性能优化和高可用架构技术宝典,直接封神!
- 18.支持向量机(SVM)的介绍
- Shell implementation based on stm32
- C陷阱与缺陷 第7章 可移植性缺陷 7.1 应对C语言标准变更
- Mathematical Principles of Graph Convolutional Neural Networks——A Preliminary Study on Spectral Graph Theory and Fourier Transform
- Excel导入和导出
- C陷阱与缺陷 第7章 可移植性缺陷 7.2 标识符名称的限制
- 千亿级、大规模:腾讯超大 Apache Pulsar 集群性能调优实践
- SQL存储过程详解
猜你喜欢

测试行业干了5年,从只会点点点到了现在的测试开发,总算是证明了自己

JMeter笔记3 | JMeter安装和环境说明

基于MATLAB的电力系统短路故障分析与仿真

关于内和调试无法查看ntdll内存的问题

多年以后「PageHelper」又深深的给我上了一课

论文阅读之《Underwater scene prior inspired deep underwater image and video Enhancement (UWCNN)》

BCryptPasswordEncoder的使用及原理

Basic knowledge points in js - BOM

JMeter笔记4 | JMeter界面介绍

Mathematical Principles of Graph Convolutional Neural Networks——A Preliminary Study on Spectral Graph Theory and Fourier Transform
随机推荐
基于MATLAB的电力系统短路故障分析与仿真
PyTorch 猫狗分类源代码及数据集
游戏化产品搭建思路的拆解与探究
leetcode-1319:连通网络的操作次数
JVM诊断命令jcmd介绍
升级 MDK 5.37 后的问题处理: AC6编译选项, printf, 重启失效等
LayaBox---TypeScript---类型推论
LayaBox---TypeScript---类
LayaBox---TypeScript---枚举
Moralis去中心化Web3应用开发教程
2022年杭电多校第2场 1001 Static Query on Tree(树链剖分+哈希表差分
leetcode-684:冗余连接
17.机器学习系统的设计
js中的基础知识点 —— BOM
Dodging ice cream assassins?Crawling ice cream prices through crawlers
数据库系统原理与应用教程(067)—— MySQL 练习题:操作题 82-89(十一):数据的增、删、改操作
千亿级、大规模:腾讯超大 Apache Pulsar 集群性能调优实践
沃尔沃中国的年中总结,在“安全感”中寻找未来
超声波探伤仪是做什么用的?
数据库系统原理与应用教程(065)—— MySQL 练习题:操作题 62-70(九):分组查询与子查询