This release is a pre-release and may not be stable for production use.
rapidocr 5
rapidocr_ng 5.0.0a2 is published on PyPI as
rapidocr_ng, separate from the official
rapidocr. The import name is still
rapidocr: pip install rapidocr_ng, then from rapidocr import RapidOCR.
Both projects install the same rapidocr package directory, so do not install
them in one environment (run pip uninstall rapidocr first). This line is the native PP-OCRv6 engine on the V5_NG branch.
The 3.x line (latest tag v3.9.2) stays on main. This repository has no
4.x release.
from rapidocr import RapidOCR, __version__
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(__version__)
print(result.txts, result.scores)
print(result.to_json())
If model paths are omitted, RapidOCR() downloads the same files as 3.x:
default_models.yaml selects the URL, the file is saved under
Global.model_root_dir (the package models/ directory when that is null)
using the URL filename, and the SHA256 is checked. download_models() and
download_models(config_yaml) follow 3.x and return None. PP-OCRv6 ONNX
recognizers also download the dictionary published next to the MNN bundles
(ppocrv6_tiny_dict.txt / ppocrv6_dict.txt).
Build from a checkout (CMake and a C++20 compiler required). The repository root is the installable project, so the sdist contains the native sources:
pip install .
pip install ./python also works from a checkout, because that project
points CMake at the parent tree. It does not produce a self-contained sdist.
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.
Vulkan
Wheels are built with -DPPOCR_ENABLE_VULKAN=OFF. They do not contain the
compute shaders and do not need libvulkan. A checkout that has the
Vulkan-Headers submodule and glslangValidator can build a Vulkan-enabled
package with:
CMAKE_ARGS="-DPPOCR_ENABLE_VULKAN=ON -DPPOCR_BUILD_STATIC=OFF" pip install .
The runtime opens libvulkan.so.1 with dlopen. It is not linked into the
library. Enable it per engine, in the same style as 3.x use_cuda:
engine = RapidOCR(params={
"EngineConfig.ppocr_cpp.use_vulkan": True,
"EngineConfig.ppocr_cpp.device_index": 0,
})
device_index -1 skips CPU Vulkan devices such as lavapipe. Set it to the
lavapipe index (0 when it is the only device) together with
VK_ICD_FILENAMES pointing at lvp_icd.json. If no compute device exists,
the call logs a warning and runs on CPU. backend: vulkan is the same
attempt. backend: hybrid matches the C++ hybrid path. See docs/API.md.
Migrating from rapidocr 3.x
RapidOCR(config_path=..., params={"Section.key": value}) and
engine(img, use_det=..., use_cls=..., use_rec=..., text_score=..., box_thresh=..., unclip_ratio=...)
keep the same names. result.txts, result.scores, result.boxes,
result.elapse, to_json(), to_markdown(), and vis() are still there.
File paths, URLs, bytes, and PIL images are RGB. A numpy array is treated as
BGR, then swapped, which is what 3.x does for OpenCV images.
What does not carry over from 3.x:
3.x (main) |
rapidocr 5 |
|---|---|
| ONNX Runtime, OpenVINO, Paddle, PyTorch, TensorRT, MNN | Built-in PP-OCRv6 interpreter. EngineType.ONNXRUNTIME and EngineType.PPOCR_CPP both select it. The other engine names raise NotImplementedError. |
| PP-OCRv4 and PP-OCRv5 model zoo | PP-OCRv6 ONNX detector and recognizer only. |
Angle classifier (use_cls=True by default) |
The cls file is downloaded like 3.x. The native engine does not run it, and logs one warning. |
use_det=False or use_rec=False |
Raises RapidOCRError. Detection and recognition always run together. |
| Word and character boxes | return_word_box / return_single_char_box warn. word_results is empty. |
elapse_list is [det, cls, rec] |
[None, None, total]. The native call is one timed region. An empty page is RapidOCROutput() (boxes/txts/img are None), same as 3.x. |
vis() draws with OpenCV in BGR |
vis() draws with Pillow and returns RGB. |
EngineConfig (CUDA, OpenVINO, TensorRT, MNN, …) |
Those keys load and can be read. They are not applied. EngineConfig.ppocr_cpp.use_vulkan, backend (cpu, hybrid, vulkan), and device_index are applied. |
Detector mean/std, limit_type, limit_side_len, use_dilation |
Passed through the C ABI and applied. mean/std are B, G, R, the same order as an OpenCV image. Recognizer normalization defaults to 0.5/0.5, matching 3.x. |
Global.min_height, vertical padding, max_side_len |
Applied before the native call, and boxes are mapped back. |
A call that only reads txts, scores, and boxes from a PP-OCRv6 model
can switch by installing this package and leaving use_cls at its default.
Set use_cls=False to skip the warning. Do not pass use_det=False or an
older OCR version.
Wheels and publishing
.github/workflows/build-wheels.yml builds the manylinux2014 wheels and the
sdist. It runs on pushes and pull requests to V5_NG, on tags named v5*,
and from the Actions “Run workflow” button. A normal push does not upload
anything to PyPI. Publishing happens only when a v5* tag is pushed.
5.0.0a2 is a pre-release: pip install --pre rapidocr_ng or
pip install rapidocr_ng==5.0.0a2. pip install rapidocr installs the
official 3.x package instead.
How to turn on PyPI Trusted Publishing, which tag to push, and the Actions
permission the GitHub Release step needs are in
docs/RELEASING.md.
Ported from main (#755)
RawMemoryImage(address, length, width, height, pixel_format="BGRA", stride=None, bottom_up=False)reads an uncompressed pixel buffer (GRAY/BGR/RGB/BGRA/BGRX/RGBA/RGBX) by address.bytes,bytearray,MemoryImageand PIL inputs honor the EXIF orientation, like paths.- Model routing lives in
default_models.yamlundermodel_routes.RapidOCR.list_supported_langs("rec", "PP-OCRv6", "tiny")andrapidocr --list-langs --task rec --ocr_version PP-OCRv6 --model_type tinylist the languages. Global.model_root_diracceptsstrorPath; the recognizer dictionary is stored there too.- No OpenCV dependency or extra.
Metadata
Release files for rapidocr-ng 5.0.0a5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rapidocr_ng-5.0.0a5.tar.gz | 947.3 kB | Details |
Built distributions (wheels)
Total release size: 53.0 MB
Release files / rapidocr_ng-5.0.0a5.tar.gz
| Download URL | rapidocr_ng-5.0.0a5.tar.gz |
|---|---|
| Size | 947.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
923f9e783b7a88aad47caa76aab5f79b1aa133b019185e023a279b51942aaec1
|
|
BLAKE2b-256 checksum How to use checksums |
60382ecfaeee1d062dc2f56ccf99e947930448b422b948f3b2521d00b4fa2428
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp313-cp313-win_amd64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b417f7b0eaf849c62f6e0858d3dbc8f5e18c9b8041c46c4b2e77249548125465
|
|
BLAKE2b-256 checksum How to use checksums |
8552dbefac70eafd8659b4a96dfb2a7b547ef22c1187127446dbd82eaf3e5c78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
5461dade0cb4de652a1dc4cd17728238cd1525f526a96ed96d5539ee99897e4a
|
|
BLAKE2b-256 checksum How to use checksums |
a851cb1fada5ff5a32f2b20c9a7abdd9de14bf043eaac226d4cf1f095bd78299
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
df57e7f9256f3d9ddff798fcbf75fed5729a20e5270daa271e4d1bd5e8c69f06
|
|
BLAKE2b-256 checksum How to use checksums |
d750b8916e92709a2f8909eeab704af583ff125c16c9b9ef447786c84c6ec192
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp313-cp313-macosx_14_0_arm64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp313-cp313-macosx_14_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.13 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ea1f10304d710a7c3b08b24f9626c7deeee6c8d7dfdf10edc8d697de9ae0842d
|
|
BLAKE2b-256 checksum How to use checksums |
27820c2c4712cdaa3a0ce3ba435825d93fe15d93df83df14995aa41e5840a428
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp312-cp312-win_amd64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
26065b6b3b209ebc153496694f86ca15b5b63fbd5147565931ffa6c14f5cc675
|
|
BLAKE2b-256 checksum How to use checksums |
b8cf0bb88c96b9abf3736b658e952c74f95080aa57ca6e7deaba46551d8f8358
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
11e8be6555c4d8f01d2c5dac780f3e54ffda8a28780033fad9946739a16669d9
|
|
BLAKE2b-256 checksum How to use checksums |
3d4e5b0dd8afcdbf93a3e0b1c81ea341e42139a7055f8ef99e251aff5c3da242
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
fa967d34383936102c833c035ccf184592da6b34a7cb9365bce3096644a97da1
|
|
BLAKE2b-256 checksum How to use checksums |
74062a60116f6ec0e9877cdd84da13e56ca1ccb74de3f1c025e55754ceca9e5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp312-cp312-macosx_14_0_arm64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp312-cp312-macosx_14_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.12 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c2668611566cd31b2298d13c4e4ca6fe25425b882e2ce29b9f2b24f443b6c5f8
|
|
BLAKE2b-256 checksum How to use checksums |
9812ed7e97029f0d87c84bc07633d9834d87a2fa2d99ea55ae8f9bfde827c96d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp311-cp311-win_amd64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
217bd44ed269c59038543d33a7ab0ef684274e1028c95f37188472dd8b05ace0
|
|
BLAKE2b-256 checksum How to use checksums |
cc48b84646f294b5025c58da8e025997ddc1508c81d3eeb91d3b7259fe0dcc47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
dc7e41d8a1b4838701d8fe5d213db0c337907d6badb5f2115104973fae731712
|
|
BLAKE2b-256 checksum How to use checksums |
49e0ea0e1ad0763b6f58059e5aac4acc2fccec1637b8c6772d110c56f2663fe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
7409bf11f982661ba28f5c9e1e2e85fbbb53b4f4871cd43af75018ba9af9475f
|
|
BLAKE2b-256 checksum How to use checksums |
a0be328d520ba02becfe6298eecb8e7f14f33aafd2fee2815256a4da49125b6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp311-cp311-macosx_14_0_arm64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp311-cp311-macosx_14_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.11 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8194bf4a08675c88631b178933ebc8739b4a2a15f8404bf90fa7a52dc40adf87
|
|
BLAKE2b-256 checksum How to use checksums |
eda32daf795400124727b710ee1b20ac2f31f1ff17cb709cb3ce8819e6e83b58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp310-cp310-win_amd64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a1b33913d0e0c3e3eabd925401b9c112ec57bb88ec26635b77a4882a3851cf78
|
|
BLAKE2b-256 checksum How to use checksums |
9def107e1119ec804cf115eb0d510d309513600ec82628e6294ccca5008d64ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
13f98953195a014ba7ea539251402a3595104335cbc03f388ccd7d7b23e6d4a3
|
|
BLAKE2b-256 checksum How to use checksums |
826b7e6d502948af7c6e15efaa47428f957f9cad455ac36dd6e59cbbcb06dc41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
e1192ad29f37ccaf1c80746b5478eefccf91ffc2719b359ec4fc583569ea0e68
|
|
BLAKE2b-256 checksum How to use checksums |
10e15c5d0bd801012d09bf3389f32c32c562cf0b3c55270ccb9c7ea53b30a04b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp310-cp310-macosx_14_0_arm64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp310-cp310-macosx_14_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.10 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7b401bbe4221a55b483b46a954fa497e8e0052dd377728612f81b212a4d98c9d
|
|
BLAKE2b-256 checksum How to use checksums |
093ac3d6cdad02d39f824abf6a7f43297018c234fc615f9bf26af8003156b991
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp39-cp39-win_amd64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3352bdaae575dbd09cfb71d0b3c994f201874e1e38f0361d60e90710bd335964
|
|
BLAKE2b-256 checksum How to use checksums |
315e1e05b56472a70266ecafe55281b8d9b31818413782bcdb6f209fee155701
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
460a9589a270c5635f0f914d784ef5f50a71538a8ce5d63d13d34dc0c7c9c01b
|
|
BLAKE2b-256 checksum How to use checksums |
7af61f1fe2895226cdf275faefb7652b96fa1d94b18227c0b9eb8b4165a5aec0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
89557a18fdcd170a693ac905f1f7e84232ebcc54e758d129cdf8a3f2d810a46a
|
|
BLAKE2b-256 checksum How to use checksums |
8ca39f45ae3b1626d1cc80f75f021cc0393cee874b44000f0fd1c3673ca8bdc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rapidocr_ng-5.0.0a5-cp39-cp39-macosx_14_0_arm64.whl
| Download URL | rapidocr_ng-5.0.0a5-cp39-cp39-macosx_14_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.9 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c8c7d0ccd9bb87bae0c15b4e37e5fe25a2d0a01c8b11bbfd9b97587fe3d198fd
|
|
BLAKE2b-256 checksum How to use checksums |
9fcacf946562e727c60c2bf6e7ed0cea0e86af5a02324478554568c5ebf232fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|