Files
rapidocr/python/README.md
Cursor AgentandDaniel 3622c4598e feat: add C ABI, Python package, and CPU ISA paths
Expose the PP-OCRv6 engine through a stable C ABI and installable
shared and static libraries, plus a ctypes Python package that follows
the RapidOCR call shape. Keep AVX-512 out of the AVX2 object file and
speed up GEMM accumulate and the AArch64 GEMM tile.

Co-authored-by: Daniel <znsoft@163.com>
2026-10-04 23:40:06 +00:00

35 lines
987 B
Markdown

# rapidocr (native PP-OCRv6)
Python package for the `V5_NG` C++ engine. The import surface follows
`rapidocr` on `main`:
```python
from rapidocr import RapidOCR
engine = RapidOCR(params={
"Det.model_path": "PP-OCRv6_det_tiny.onnx",
"Rec.model_path": "PP-OCRv6_rec_tiny.onnx",
"Rec.rec_keys_path": "ppocrv6_tiny_dict.txt",
"Global.use_cls": False,
})
result = engine("page.png")
print(result.txts, result.scores)
print(result.to_json())
```
If model paths are omitted, the package downloads the PP-OCRv6 ONNX bundle
for `Det.model_type` / `Rec.model_type` (`tiny`, `small`, or `medium`).
Build a wheel from a checkout that already has the Vulkan-Headers submodule:
```bash
pip install scikit-build-core
pip install ./python
```
The binding is ctypes over the C ABI (`include/ppocr/ppocr.h`), so the wheel
ships `libppocr` and does not add a second C++ wrapper.
See `docs/API.md` for the differences from `main` (no angle classifier, no
word boxes, PP-OCRv6 only).