Skip to content

Conversation

@lzwind
Copy link
Contributor

@lzwind lzwind commented Dec 11, 2025

合并ocr分支

gerritadmin and others added 9 commits August 2, 2022 11:05
Initialize the deepin-ocr-plugin-manager repository.
仓库初始化

Log: 仓库初始化
Change-Id: I177ef20d2f5a0fd121bbd6239b1c6f9b10e72605
增加玲珑构建,完善资源文件搜索机制

Log: 增加玲珑构建,完善资源文件搜索机制
Change-Id: Ia6b5ca6e3ecb10c22b19895aa984a96f65f03120
修改部分接口细节

Log: 修改部分接口细节
Change-Id: I235a1669b6520cecb5891493d18f3b6398430a10
原因是检测算法认为这里有文字,但识别算法认为那不是文字
解决方法是在最终输出结果前,将未识别到文字的检测框删除

Log: 修复部分检测框内无法复制出文字
Change-Id: If6d1756ee44fee3dc2c1656fc35bd74ea042a611
Description: 对获取的环境变量指针使用strtok()导致字符串插入‘\0’,使得指针指向的环境变量被改变,导致通过“XDG_DATA_DIRS”获取信息的部分功能受影响。

Log: 修复strtok()函数会破坏字符串导致影响“XDG_DATA_DIRS”环境变量的问题
Bug: https://pms.uniontech.com/bug-view-166911.html
Influence: 插件加载不影响环境变量
Change-Id: I5250f3701f9b2852d2d85178c16d71f3ff384bc7
Fixed the OCR recognition crash

Bug: https://pms.uniontech.com/bug-view-290551.html,
     https://pms.uniontech.com/bug-view-290549.html
Log: Fixed the OCR recognition crash
Change-Id: Iab061d063005803ccbcabbd2e0e9a467032965ce
update changelog

update changelog

Change-Id: I66f582bb4e3fdbb888113fe2787222b4ed3ca736
Merge the develop/snipe branch from gerrit into master branch.
This includes fixes for OCR recognition crash and other improvements.
@github-actions
Copy link

TAG Bot

TAG: 1.0.1
EXISTED: no
DISTRIBUTION: unstable

@lzwind lzwind force-pushed the master branch 3 times, most recently from bfea14b to 2cd7b03 Compare December 11, 2025 06:02
- Add comprehensive README.md with project description, usage examples
- Add LICENSE file pointing to GPL-3.0-or-later
- Add LICENSES/ directory with full license texts (GPL-3.0-or-later, Apache-2.0, MIT, BSL-1.0)
- Add .reuse/dep5 configuration file for REUSE compliance
- Update README with REUSE compliance information
Add README.zh_CN.md file to provide Chinese documentation for the project.
This file contains comprehensive information about the project including
introduction, features, dependencies, build instructions, usage examples,
and license information.
@deepin-ci-robot
Copy link

deepin pr auto review

我来对这个git diff进行代码审查。这个diff主要涉及许可证文件的添加和代码的修改。让我们逐个部分分析:

  1. 许可证文件(.reuse/dep5, LICENSE, LICENSES/*)
    这些是新增的许可证相关文件,符合REUSE规范。格式正确,包含了所有必要的许可证声明。没有发现问题。

  2. README文件(README.md, README.zh_CN.md)
    新增的README文件内容完整,包含了项目介绍、功能特性、依赖要求、构建安装说明等。文档结构清晰,内容准确。没有发现问题。

  3. debian/changelog
    更新了版本号和变更记录,格式符合Debian changelog规范。没有发现问题。

  4. 源代码修改(src/deepinocrplugin.cpp, src/paddleocr-ncnn/paddleocr.cpp)

在deepinocrplugin.cpp中:

  • 删除了多余的空行,这是一个好的代码风格改进。

在paddleocr.cpp中:

  • 添加了对龙芯架构的特殊处理
  • 修改了Vulkan计算的条件判断

让我们重点分析paddleocr.cpp中的修改:

#if defined(_loongarch) || defined(__loongarch__) || defined(__loongarch64)
            extractor.set_vulkan_compute(false);
#else
            if (maxThreadsUsed > 1 && i % maxThreadsUsed != 1) {
                extractor.set_vulkan_compute(false);
            }
#endif

改进建议:

  1. 代码逻辑:
  • 这个修改是为了处理龙芯架构的特殊情况,直接禁用Vulkan计算是合理的,因为龙芯架构可能对Vulkan支持不完善。
  • 但是建议添加注释说明为什么龙芯架构需要特殊处理,这样其他开发者更容易理解这个特殊情况的背景。
  1. 代码安全:
  • 这个修改不会引入安全风险,只是针对特定硬件架构的适配。
  1. 代码性能:
  • 对于龙芯架构,禁用Vulkan可能会影响性能,但这是必要的妥协,因为Vulkan支持可能不稳定。
  • 对于其他架构,保持了原有的优化逻辑。
  1. 建议的改进:
#if defined(_loongarch) || defined(__loongarch__) || defined(__loongarch64)
            // 龙芯架构暂时禁用Vulkan计算,因为当前Vulkan驱动支持不完善
            extractor.set_vulkan_compute(false);
#else
            // 当可用线程 > 1 同时不是第 1 个线程时,使用CPU进行计算
            // 这样可以避免多个线程同时使用GPU导致的性能问题
            if (maxThreadsUsed > 1 && i % maxThreadsUsed != 1) {
                extractor.set_vulkan_compute(false);
            }
#endif

总结:
这个diff整体上是好的改进,主要是:

  1. 添加了完整的许可证文件,符合REUSE规范
  2. 改进了代码风格
  3. 增加了对龙芯架构的支持

唯一需要改进的是在paddleocr.cpp中添加更详细的注释,说明特殊处理的原因。这样可以让代码更容易维护和理解。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, wyu71

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lzwind lzwind merged commit af71ff3 into linuxdeepin:master Dec 11, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants