Smobiler针对百度文字识别SDK动态编译与运行
下载百度ocr
创新互联从2013年开始,是专业互联网技术服务公司,拥有项目做网站、成都做网站网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元镇赉做网站,已为上家服务,为镇赉各地企业和个人服务,联系电话:18980820575
- 在百度ocr平台下载android资源文档
- 文档地址:https://ai.baidu.com/docs#/OCR-Android-SDK/top
- sdk下载地址:http://ai.baidu.com/sdk/#ocr
针对SDK中ui_ocr
针对jar包中没有资源文件问题,需要把ui_ocr的整个module打包上传到jcenter,并把非资源部分src文件夹打包成jar嵌入编译
如果sdk中只有jar或者jar和so,可直接跳到下一步:生成zip资源包
- 上传ui_ocr到jcenter
- 在https://bintray.com/上注册一个账号。并获取API Key https://bintray.com/profile/edit
- 打开OCRDEMO,修改项目目录下的 build.gradle,添加依赖

- 修改要ui_ocr的moudle下的build.gradle



- 执行 bintrayUpload,当bintrayUpload成功之后,到 https://bintray.com/ 查看刚上传的项目,找到 Maven Central 标签,提示jcenter审核
- 上传到 jcenter等邮件通知,审核通过之后可以查看,到http://jcenter.bintray.com/ 按照路径查看是否存在
- 具体可参考:https://blog.csdn.net/hpu_zyh/article/details/49535929
- 打包jar供smobiler调用
- 修改要ui_ocr的moudle下的build.gradle,添加以下内容,rename中myjar.jar可修改为自己想定义的jar的名称(例如:)

- 然后找到cmd命令行输入:gradlew makeJar 回车就好了

- 具体可参考:https://blog.csdn.net/xiayiye5/article/details/79639044
生成zip资源包
- 把百度ocr中的jar和so分别放入jar文件夹和libs文件夹,并压缩成baiduocr.zip(不要压缩在外层文件夹)

云平台上传资源
- 把生成的资源上传smobiler云平台
- 生成的baiduocr.zip资源包
- 添加jcenter上传的文件路径(例如: com.smobiler:baiduocr:1.0.0)
- 生成独立的baiduocr选项
- 打包时选择sm_compiler插件,并选择baiduocr选项,打包即可
- 打包完成后,即可在服务端动态调用baiduocr的接口.
当前标题:Smobiler针对百度文字识别SDK动态编译与运行
网站地址:
http://csdahua.cn/article/gddeij.html
扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流