Skip to content

fix(ocr): 恢复中英文自动推荐的旧版模型 - #793

Merged
longer-sausage merged 1 commit into
wess09:devfrom
longer-sausage:dev
Aug 19, 2026
Merged

fix(ocr): 恢复中英文自动推荐的旧版模型#793
longer-sausage merged 1 commit into
wess09:devfrom
longer-sausage:dev

Conversation

@longer-sausage

@longer-sausage longer-sausage commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary by Sourcery

恢复特定语言的旧版模型推荐,用于自动 OCR 识别。

Bug Fixes:

  • 恢复用于自动识别英文和简体中文的旧版 OCR 模型默认设置。

Enhancements:

  • 让日文和繁体中文的自动识别继续使用标准的 PP-OCRv6 模型。
  • 更新 OCR 模型文档,以反映按语言自动选择模型的行为。
Original summary in English

Summary by Sourcery

Restore language-specific legacy model recommendations for automatic OCR recognition.

Bug Fixes:

  • Restore legacy OCR model defaults for automatic English and Simplified Chinese recognition.

Enhancements:

  • Keep Japanese and Traditional Chinese automatic recognition on the standard PP-OCRv6 models.
  • Update OCR model documentation to reflect language-specific automatic model selection.

@github-actions

Copy link
Copy Markdown

⏳ CI 检查进行中,报告将在完成后更新。

@longer-sausage
longer-sausage merged commit 63f58e1 into wess09:dev Aug 19, 2026
5 checks passed
@sourcery-ai

sourcery-ai Bot commented Aug 19, 2026

Copy link
Copy Markdown
审阅者指南(在小型 PR 上折叠)

审阅者指南

更新 OCR 默认设置,使英文和简体中文自动配置文件使用旧版 AlOCR 模型,并将文档 / agent / i18n 描述与新行为保持一致。

更新后 OCR 默认模型选择的流程图

flowchart LR
    AutoProfile[Auto profile selection]
    LangEN[English azur_lane]
    LangCN[Simplified Chinese cn]
    LangJP[Japanese jp]
    LangTW[Traditional Chinese tw]

    AutoProfile --> LangEN
    AutoProfile --> LangCN
    AutoProfile --> LangJP
    AutoProfile --> LangTW

    LangEN --> ModelEN[DEFAULT_ONNX_MODEL_VERSION.azur_lane = alocr_en_v2_6]
    LangCN --> ModelCN[DEFAULT_ONNX_MODEL_VERSION.cn = alocr_cn_v3]
    LangJP --> ModelJP[DEFAULT_ONNX_MODEL_VERSION.jp = standard]
    LangTW --> ModelTW[DEFAULT_ONNX_MODEL_VERSION.tw = standard]
Loading

文件级改动

Change Details Files
将英文(Azur Lane)和简体中文逻辑模型的默认 ONNX 模型版本更改为使用旧版 AlOCR 模型,而不是 PP-OCRv6 standard。
  • 更新 azur_lane 逻辑模型的 DEFAULT_ONNX_MODEL_VERSION 条目,使其使用 alocr_en_v2_6 变体。
  • 更新 cn 逻辑模型的 DEFAULT_ONNX_MODEL_VERSION 条目,使其使用 alocr_cn_v3 变体。
module/ocr/al_ocr.py
调整 README 文档,以描述语言特定 OCR 模型新的自动配置默认值。
  • 明确说明英文和简体中文自动槽位现在默认使用对应的旧版模型。
  • 保留 PP-OCRv6 standard 作为日文和繁体中文的默认模型,并注明其他版本需通过 GUI 手动切换。
bin/ocr_models/README.md
更新内部 agent 文档,使其与新的 DEFAULT_ONNX_MODEL_VERSION 行为保持一致。
  • 修订 DEFAULT_ONNX_MODEL_VERSION 的描述,使英文和简体中文被记录为默认使用旧版 AlOCR 模型,而其他语言默认使用 standard 模型。
  • 保持本节其余部分(模型列表和字典用法)与现有行为一致。
.agent/OCR.md
同步 i18n 字符串,使其与新的 OCR 模型默认行为一致(详情在 diff 片段中不可完全见到)。
  • 调整英文、日文、简体中文、苗文和繁体中文本地化字符串,以描述更新后的默认模型选择和自动槽位行为。
  • 确保 GUI 相关的关于 OCR 模型版本、自动选择或旧版模型的文本在各语言环境中一致。
module/config/i18n/en-US.json
module/config/i18n/ja-JP.json
module/config/i18n/zh-CN.json
module/config/i18n/zh-MIAO.json
module/config/i18n/zh-TW.json

技巧和命令

与 Sourcery 交互

  • 触发新的审阅: 在 pull request 上评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 通过回复某条审阅评论,请求 Sourcery 从该评论创建一个 issue。你也可以回复该审阅评论并写上 @sourcery-ai issue 来生成 issue。
  • 生成 pull request 标题: 在 pull request 标题任意位置写上 @sourcery-ai,即可随时生成标题。也可以在 pull request 上评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文任意位置写上 @sourcery-ai summary,即可在指定位置随时生成 PR 摘要。也可以在 pull request 上评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 上评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 pull request 上评论 @sourcery-ai resolve,即可标记解决所有 Sourcery 评论。如果你已经处理了所有评论且不再想看到它们,这会很有用。
  • 关闭所有 Sourcery 审阅: 在 pull request 上评论 @sourcery-ai dismiss,即可关闭所有现有的 Sourcery 审阅。特别适用于你希望从头开始新的审阅——别忘了再评论 @sourcery-ai review 以触发新的审阅!

自定义你的使用体验

访问你的 dashboard 以:

  • 启用或禁用审阅功能,例如 Sourcery 生成的 pull request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、移除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Update OCR defaults so English and Simplified Chinese auto profiles use legacy AlOCR models, and align documentation/agent/i18n descriptions with the new behavior.

Flow diagram for updated OCR default model selection

flowchart LR
    AutoProfile[Auto profile selection]
    LangEN[English azur_lane]
    LangCN[Simplified Chinese cn]
    LangJP[Japanese jp]
    LangTW[Traditional Chinese tw]

    AutoProfile --> LangEN
    AutoProfile --> LangCN
    AutoProfile --> LangJP
    AutoProfile --> LangTW

    LangEN --> ModelEN[DEFAULT_ONNX_MODEL_VERSION.azur_lane = alocr_en_v2_6]
    LangCN --> ModelCN[DEFAULT_ONNX_MODEL_VERSION.cn = alocr_cn_v3]
    LangJP --> ModelJP[DEFAULT_ONNX_MODEL_VERSION.jp = standard]
    LangTW --> ModelTW[DEFAULT_ONNX_MODEL_VERSION.tw = standard]
Loading

File-Level Changes

Change Details Files
Change default ONNX model versions for English (Azur Lane) and Simplified Chinese logical models to use legacy AlOCR models instead of PP-OCRv6 standard.
  • Update DEFAULT_ONNX_MODEL_VERSION entry for the azur_lane logical model to use the alocr_en_v2_6 variant.
  • Update DEFAULT_ONNX_MODEL_VERSION entry for the cn logical model to use the alocr_cn_v3 variant.
module/ocr/al_ocr.py
Adjust README documentation to describe new auto-profile defaults for language-specific OCR models.
  • Clarify that English and Simplified Chinese auto slots now default to their corresponding legacy models.
  • Retain PP-OCRv6 standard as the default for Japanese and Traditional Chinese, and note manual GUI switching for other versions.
bin/ocr_models/README.md
Update internal agent documentation to match the new DEFAULT_ONNX_MODEL_VERSION behavior.
  • Revise description of DEFAULT_ONNX_MODEL_VERSION so that English and Simplified Chinese are documented as defaulting to legacy AlOCR models, with other languages defaulting to standard.
  • Keep the rest of the section (model list and dictionary usage) consistent with existing behavior.
.agent/OCR.md
Synchronize i18n strings with the new OCR model default behavior (details not fully visible in the diff snippet).
  • Adjust English, Japanese, Simplified Chinese, Miao, and Traditional Chinese locale strings to describe the updated default model selection and auto-slot behavior.
  • Ensure GUI-facing text about OCR model versions, auto selection, or legacy models is consistent across locales.
module/config/i18n/en-US.json
module/config/i18n/ja-JP.json
module/config/i18n/zh-CN.json
module/config/i18n/zh-MIAO.json
module/config/i18n/zh-TW.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些整体性的反馈:

  • 建议在 DEFAULT_ONNX_MODEL_VERSION 附近添加一段简短的行内注释,说明为什么英语 / 碧蓝航线(Azur Lane)和简体中文默认使用旧版(legacy)模型,而日文 / 繁中(JP/TW)保持为 standard,以帮助后续维护者理解这种“混合默认值”配置背后的原因。
  • 请再次确认 DEFAULT_ONNX_MODEL_VERSION 中的键(如 azur_lanecn 等)是否与 auto 被解析时使用的逻辑模型标识完全一致;如果命名有任何偏差,可能会在无提示的情况下回退到非预期的默认值。
给 AI 代理(Agents)的提示
Please address the comments from this code review:

## Overall Comments
- Consider adding a brief inline comment near `DEFAULT_ONNX_MODEL_VERSION` explaining why English/Azur Lane and Simplified Chinese default to legacy models while JP/TW stay on `standard`, to help future maintainers understand the mixed-default rationale.
- Double-check that the keys in `DEFAULT_ONNX_MODEL_VERSION` (`azur_lane`, `cn`, etc.) exactly match the logical model identifiers used when `auto` is resolved; if any naming diverges, it could silently fall back to unintended defaults.

Sourcery 对开源项目是免费的——如果你喜欢我们的评审,请考虑帮忙分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • Consider adding a brief inline comment near DEFAULT_ONNX_MODEL_VERSION explaining why English/Azur Lane and Simplified Chinese default to legacy models while JP/TW stay on standard, to help future maintainers understand the mixed-default rationale.
  • Double-check that the keys in DEFAULT_ONNX_MODEL_VERSION (azur_lane, cn, etc.) exactly match the logical model identifiers used when auto is resolved; if any naming diverges, it could silently fall back to unintended defaults.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a brief inline comment near `DEFAULT_ONNX_MODEL_VERSION` explaining why English/Azur Lane and Simplified Chinese default to legacy models while JP/TW stay on `standard`, to help future maintainers understand the mixed-default rationale.
- Double-check that the keys in `DEFAULT_ONNX_MODEL_VERSION` (`azur_lane`, `cn`, etc.) exactly match the logical model identifiers used when `auto` is resolved; if any naming diverges, it could silently fall back to unintended defaults.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant