* feat(python): support PP-OCRv6 for onnxruntime and openvino
Add PP-OCRv6 rec and det models (tiny/small/medium) for onnxruntime and openvino engines. v6 ships no cls model; reuse PP-OCRv5 cls.
- typings.py: add OCRVersion.PPOCRV6 and ModelType.TINY/SMALL/MEDIUM
- default_models.yaml: add PP-OCRv6 blocks under onnxruntime/openvino with PaddlePaddle official ModelScope URLs, verified SHA256, and dict_url (PaddleOCR dict files)
Verified end-to-end on ch_en_num.jpg with v6 small det+rec + v5 cls (onnxruntime): 18 text lines recognized correctly.
* fix(python): use uniquely-named PP-OCRv6 model URLs to avoid cache collision
PP-OCRv6 official ONNX exports are all named inference.onnx, causing det and rec models to overwrite each other in RapidOCR's cache (cache_dir/Path(url).name). Switch model_dir/dict_url to a mirror with unique filenames (ch_PP-OCRv6_<task>_<size>.onnx) under modelscope.cn/models/jaminmei/PP-OCRv6-onnx@v1.0. SHA256 unchanged (byte-identical files, renamed only).
Verified onnxruntime + openvino: no more redownload-on-collision; second run is pure cache hit.
* test(python): add PP-OCRv6 det/rec unit tests for onnxruntime and openvino
Mirror the test_ppocrv5_det/rec_mobile pattern. v6 small det on ch_en_num.jpg -> 18 boxes; v6 small rec on text_rec.jpg -> '韩国小馆'. Parametrized over the two engines v6 supports (ONNXRUNTIME, OPENVINO). Existing 100 tests unaffected (verified via collect-only).
Verified: 4 new tests pass (onnxruntime + openvino x det/rec).
* chore(python): switch PP-OCRv6 model URLs to official RapidAI/RapidOCR repo
- det/rec x tiny/small/medium now point to modelscope.cn/RapidAI/RapidOCR (official SWHL conversion, not contributor mirror)
- update SHA256 to the official files' hashes
- drop rec dict_url: official ONNX embeds the character list in metadata (session.have_key() path), matching v4/v5 onnx convention
- verified: 4 v6 unit tests pass; det benchmark Hmean identical to prior mirror-based run (0.8263/0.8492/0.8421 for tiny/small/medium)
* chore: add pyproject toml configuration
* build: migrate RapidOCR wheel packaging to pyproject.toml
- add PEP 517 setuptools build configuration
- derive package version from git tags via setuptools-scm
- move wheel model preparation into an explicit tools script
- generate MANIFEST.in for default model assets before building
- avoid importing rapidocr during package metadata generation
* ci: build release wheels from validated git tags
* build: align package runtime support with Python 3.8
- set Requires-Python to >=3.8
- remove Python 3.6 and 3.7 classifiers
- make wheel asset preparation script type hints Python 3.8 compatible
- clarify split between build-time and wheel runtime support
* Update to_markdown.py
修改重排规则:
中文段落
表格/多栏
标题与正文混排
OCR 框轻微倾斜
* Potential fix for pull request finding
refactor: format function call for readability
- Wrap `cls.get_gap_text` call into multi-line format
- No functional changes, only code style improvement
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- pass --lang_type into RapidOCR recognition config
- skip CLI visualization when OCR or word results are empty
- validate parameter update keys before applying config updates
- add regression tests for CLI language, empty visualization, and invalid params
Replace the single legacy Dockerfile (rapidocr_api only) with 7
per-engine development images covering all supported inference backends:
- onnxruntime-cpu: ONNX Runtime on CPU (python:3.10-slim-bookworm)
- onnxruntime-gpu: ONNX Runtime with CUDA (nvidia/cuda:12.4.1)
- tensorrt: NVIDIA TensorRT (nvcr.io/nvidia/deepstream:7.0-gc-triton-devel)
- paddle: PaddlePaddle CPU
- openvino: Intel OpenVINO
- pytorch: PyTorch CPU
- mnn: Alibaba MNN
Infrastructure:
- Dockerfile.base: shared foundation for CPU variants
- docker-compose.yaml: all 7 services with shared model volume
- Makefile: make build-*/test-*/shell-* convenience commands
- .dockerignore: excludes .git, models, build artifacts
Key design decisions:
- PYTHONPATH-based imports (setup.py incompatible with pip editable install)
- Named volume (rapidocr-models) for persistent model cache across rebuilds
- Source bind-mounted at runtime for live editing
- tensorrt pinned to 8.6.x + cuda-python 12.x (matching DeepStream 7.0)
All 7 images built and tested with full OCR pipeline inference.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>