Skip to content

fix(ocr): support Latin languages with RapidOCR ONNX#3879

Open
Success6666 wants to merge 1 commit into
docling-project:mainfrom
Success6666:fix/rapidocr-onnx-latin
Open

fix(ocr): support Latin languages with RapidOCR ONNX#3879
Success6666 wants to merge 1 commit into
docling-project:mainfrom
Success6666:fix/rapidocr-onnx-latin

Conversation

@Success6666

Copy link
Copy Markdown
Contributor

Summary

  • use PP-OCRv4 mobile models when the default ONNX path receives a language that resolves to the generic latin model set
  • keep the existing PP-OCRv6 behavior for English, Chinese, and explicitly configured model paths
  • add regression coverage for the generated RapidOCR parameters and update the language option description

Fixes #3840

Tests

  • python -m pytest tests/test_rapid_ocr_lang.py tests/test_rapid_ocr_model.py -q (19 passed)
  • python -m ruff check docling/models/stages/ocr/rapid_ocr_model.py docling/datamodel/pipeline_options.py tests/test_rapid_ocr_lang.py
  • python -m ruff format --check docling/models/stages/ocr/rapid_ocr_model.py docling/datamodel/pipeline_options.py tests/test_rapid_ocr_lang.py
  • verified with RapidOCR 3.9.1 and ONNX Runtime 1.23.2 that lang=[es] initializes successfully and runs inference on a synthetic Spanish text image
  • verified the default Chinese and English ONNX initialization paths remain successful

Checklist

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Signed-off-by: Success6666 <Success6666@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @Success6666, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

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.

RapidOCR onnx backend crashes on any Latin-script lang with default PP-OCRv6 (Unsupported rec.lang_type='latin')

1 participant