Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
增加PaddleOCR功能。
我对Kotlin不太熟悉,本次新增代码均为Java版本和目前仓库里面的Kotlin风格可能有点格格不入,作者可以后期进行转换。
首次编译需要下载OpenCV的源代码包用于编译
libs:paddleocr
这个模块,执行gradle任务downloadAndExtractArchives
即可自动下载。另外PaddleOCR只支持
arm64-v8a
和armeabi-v7a
两个平台,不支持x86
平台,因此如果打包成x86
和x86_64
是无法使用它的。文档的话可以直接参照MlKitOCR的,API为
paddle_ocr
,风格是统一的,即detect
和recognizeText
两个方法,之前没注意到MlKitOCR已经迁移进来了,哈哈。options增加:
useSlim
指定是否使用移动端优化版精简模型(默认为true)cpuThreadNum
指定模型使用CPU线程数(默认4),实际使用下来没啥区别,保持了PaddleOCR本身的参数,目前感觉意义不大。