feat: 升级PaddleOCR至v4版本,添加DevPlugin接口,修复无障碍权限和后台启动脚本问题#182
Open
xcl199f wants to merge 18 commits into
Open
Conversation
- 修复debug模式下截屏时ResourceMonitor导致的内存泄漏
1. DevPlugin.connectToComputer(String url); 2. DevPlugin.connectToSavedAddress(); 3. DevPlugin.disconnectFromComputer(); 4. DevPlugin.isComputerConnected(); 5. DevPlugin.getSavedServerAddress(); 6. DevPlugin.setServerAddress(String url); 7. DevPlugin.clearServerAddress(); 8. DevPlugin.startUSBDebug(); 9. DevPlugin.stopUSBDebug(); 10. DevPlugin.isUSBDebugActive();
- 新增 在后台运行脚本时,维持5秒前台服务通知,降低运行失败的概率
移除了v2版本,只内置了一种模型,slim参数将无效 兼容v2版本函数,新增以下函数 1. paddle.initOcr(modelPath[,labelPath, cpuThreadNum, cpuPowerMode]) 不传参数或者传null将使用默认值 2. paddle.initOcrWithConfig(config) config为字典,参考OcrConfig.kt 3. paddle.getOcrConfig() 获取当前paddleOcr配置 4. paddle.release() 释放模型资源 5. paddle.releaseDelayed(delayMillis) 延迟释放资源(默认3分钟)
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| BestPractice | 1 high |
| ErrorProne | 38 high 2 critical 48 medium |
| Performance | 11 medium |
🟢 Metrics 6784 complexity · 1342 duplication
Metric Results Complexity 6784 Duplication 1342
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Owner
|
感谢你的代码贡献,但目前提交似乎还有些问题,例如paddle ocr示例识别结果为空,v6 api无法完成编译 |
添加paddle编译需要的文件到git 添加截图权限请求失败后的重试机制
收纳侧边栏里的五个权限开关到可展开栏里
Owner
|
目前似乎还是没法通过编译,改动太大了 |
Author
|
我看到的error是Could not get resource 'https://maven.aliyun.com/repository/central/com/twofortyfouram/android-annotation/2.0.1/android-annotation-2.0.1.pom'. |
Owner
|
重新运行了一遍还是一样,似乎是添加了什么依赖与这个依赖冲突了。 |
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

🔥 核心变更
识别准确率大幅提升
完全兼容 v2 API,现有脚本无需修改
新增 initOcrWithConfig()、getOcrConfig()、release()、releaseDelayed() 方法
协程 scope 取消问题:serviceConnection.runScript 报错后导致 scope 被取消,脚本再也无法运行
✨ 其他改进
悬浮窗支持 setCoverStatusBar() 覆盖状态栏
新增 DevPlugin 接口(连接电脑/USB调试)
新增传统截图权限 requestScreenCaptureLegacy()
修复 debug 模式截屏内存泄漏
修复无障碍权限跨进程问题
后台运行增加 5 秒前台服务保活
v2 模型已移除,slim 参数无效
完全兼容 v2 API