当前位置:网站首页>【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
边栏推荐
- How Google earth engine realizes the arrangement and selection of our time list
- 主流的深度学习推理架构有哪些呢?
- C陷阱与缺陷 第7章 可移植性缺陷 7.2 标识符名称的限制
- ARC在编译期和运行期做了什么
- leetcode-684:冗余连接
- 592. Fraction Addition and Subtraction
- 5分钟搞懂MySQL - 行转列
- 基于stm32的shell实现
- What is an ultrasonic flaw detector used for?
- CMake库搜索函数居然不搜索LD_LIBRARY_PATH
猜你喜欢
Valid bracketed strings [greedy exercise]
多年以后「PageHelper」又深深的给我上了一课
un7.30:linux——如何在docker容器中安装MySQL?
宽带射频放大器OA4SMM4(1)
论文阅读之《Underwater scene prior inspired deep underwater image and video Enhancement (UWCNN)》
C陷阱与缺陷 第7章 可移植性缺陷 7.5 移位运算符
MySQL【单行函数】
5分钟搞懂MySQL - 行转列
JMeter笔记4 | JMeter界面介绍
开源盛宴ApacheCon Asia 2022即将开幕,精彩不容错过!
随机推荐
想要写出好的测试用例,先要学会测试设计
宽带射频放大器OA4SMM4(1)
This year..I sincerely recommend the professional engineer to upgrade to the book!
Prometheus 基本概念
matlab simulink锂离子电池智能充电策略研究
论文阅读之《Color Constancy Using CNNs》
首发!阿里技术大牛最新耗时半个月整理出最全MySQL性能优化和高可用架构技术宝典,直接封神!
Mathematical Principles of Graph Convolutional Neural Networks——A Preliminary Study on Spectral Graph Theory and Fourier Transform
Test the.net text to Speech module System. Researched
快使用flyway管理sql脚本吧~
JVM诊断命令jcmd介绍
图注意力机制
fast shell porting
LeetCode 952. 按公因数计算最大组件大小
C陷阱与缺陷 第6章 预处理器
数据库系统原理与应用教程(065)—— MySQL 练习题:操作题 62-70(九):分组查询与子查询
C陷阱与缺陷 第7章 可移植性缺陷 7.1 应对C语言标准变更
JMeter Notes 3 | JMeter Installation and Environment Instructions
C陷阱与缺陷 第7章 可移植性缺陷 7.2 标识符名称的限制
开源盛宴ApacheCon Asia 2022即将开幕,精彩不容错过!