除 rapidocr 外还需单独安装推理后端,如 onnxruntime;默认只支持中英文,其他语言需按文档下载对应模型;GPU 或 TensorRT 推理需按 docker/README.md 单独配置环境。

RapidOCR
RapidAIApache-2.0活跃维护基于 ONNX Runtime、OpenVINO、PaddlePaddle 等多家推理后端的 OCR 工具包,支持多语言识别,方便在不同硬件上快速部署文字检测与识别。
📄 Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.
pip install rapidocr onnxruntimeREADME 未说明具体显存要求;Docker 部分提供 onnxruntime-cpu 与 onnxruntime-gpu、tensorrt 等引擎的构建方式,说明可 CPU 运行,也可用 GPU 推理。
把 PaddleOCR 模型转成 ONNX 的离线 OCR 工具,跨平台快速部署
基于 ONNX Runtime、OpenVINO、PaddlePaddle 等多家推理后端的 OCR 工具包,支持多语言识别,方便在不同硬件上快速部署文字检测与识别。
核心能力
- 将 PaddleOCR 模型转为 ONNX 格式以加速推理部署
- 支持 ONNX Runtime、OpenVINO、MNN、TensorRT、PyTorch 等多种推理引擎
- 提供 Python、C++、Java、C# 多语言跨平台移植
- 默认支持中英文识别,可离线部署
- 可用自有数据基于 PaddleOCR 微调后接入部署
容易踩的坑
- v3.10.0Release v3.10.0最新正式版2026-10-08 · 2026-10-08 15:21 UTC
🚀 Features
- (model-routing) centralize routes in YAML and expose supported languages (#741) by SWHL in 75946b1
- (models) add multilingual model routing and licensing metadata. (issue #739) by SWHL in 4a3070f
- support loading raw memory image buffers with format and stride metadata by SWHL in deea2a0
- support decoding images from memory addresses (issue #738) by SWHL in 64b1c68
- validate python-bidi before initializing Arabic OCR (issue #719) by SWHL in 0e629c8
🐛 Bug Fixes
- (det) honour limit_side_len when limit_type is max (issue #740) (#742) by Mohammad Hijjawi in f65c7da
- (mnn) use getNumpyData() instead of getData() for output extraction (#717) by Horatiu George Todoran in 667d04c
- (nrtr) let generate_square_subsequent_mask take the device it is given (#731) by Tai An in 09f4e3b
- (pytorch) require PyTorch 1.13+ for secure model loading by SWHL in e7edb01
- (rec) honour model_root_dir for the rec dict and str paths in torch engine (#752) by Rett Wilson in 332b4fc
- correct model SHA256 by SWHL in bd941da
- load torch weights with weights_only=True to prevent code execution (#728) by Patrick Chilton in 1087d4a
- lock lazy model load so first use constructs once (#725) by Yuzhong Zhang in 486ec53
- update star-history chart by SWHL in dd48f2d
💼 Other
- (python) make OpenCV headless by default with optional GUI support (issue #737) by SWHL in c1ec605
📚 Documentation
⚡ Performance
- lazily initialize OCR models by SWHL in 0ad7c04
⚙️ Miscellaneous Tasks
- remove optional OpenCV dependency by SWHL in d6e304b
- update sponsor way by SWHL in 9936171
- ignore bundled OCR model files by SWHL in cbea36a
- update pre-commit configuration by SWHL in 9ceb342
- update star-tracker range by SWHL in 3efd66a
🎉 Contributors
- @SWHL
- [@RettWilson22](https://github
- v3.9.2Release v3.9.22026-07-21 · 2026-07-21 10:53 UTC
查看更新说明
🚀 Features
- add use_preprocess_img and use_vertical_padding logic by @SWHL in 3cc33f8
- add use_preprocess_img and use_apply_vertical_padding parameter by @SWHL in 83866d6
- verify RapidOCR model accuracy under TensorRT inference engine. Details in blog: RapidOCR PP-OCRv6 Supports TensorRT Inference Engine
🐛 Bug Fixes
- improve IDE support for lazy package exports by @SWHL in 0962933
- fixed issue #695 by @SWHL in 0fa7a96
- fixed issue #709 by @SWHL in 802c056
- align the performance of the torch version of the PP-OCRv6 Rec tiny model by @SWHL in b64a46f
🧪 Testing
- remove invalid unit testings of tensorrt module by @SWHL in c4db82f
- add PP-OCRv3 mobile unit testings by @SWHL in bce0c99
🎉 Contributors
Full Changelog: 3.9.2
- v3.9.1Release v3.9.12026-07-02 · 2026-07-02 13:52 UTC
查看更新说明
🚀 Features
- (python) add PP-OCRv6 PaddlePaddle backend support (#696) by @JinmingMei in 29b812f
- support PP-OCRv6 PyTorch as the inference engine by @SWHL in 370f01d
- add PP-OCrv6 MNN backend support.
🐛 Bug Fixes
⚙️ Miscellaneous Tasks
- update pre-commit rule by @SWHL in 7fe716f
- add missing scripts of PyTorch module by @SWHL in 2849009
🎉 Contributors
Full Changelog: 3.9.1
- v3.9.0Release v3.9.02026-06-23 · 2026-06-23 02:29 UTC
查看更新说明
Supplemental Notes for Update Log
- This release sets the PP-OCRv6 det small detection model and rec small recognition model as the default models. Benchmark metrics demonstrate that PP-OCRv6 delivers significantly better performance than PP-OCRv4.
- The total size of the whl package has increased from the previous 15 MB to 29 MB, resulting from the larger file sizes of the det small and rec small models.
- This version currently supports inference with only two engines: ONNXRuntime and OpenVINO. Support for Paddle, Torch, MNN and TensorRT will be added incrementally in subsequent releases.
补充说明
- 该版本将 PP-OCRv6 的 det small 模型和 rec small 识别模型作为了 默认模型。因为从指标来看,PP-OCRv6 效果远高于 PP-OCRv4。
- 整体 whl 包从之前的 15 MB → 29M,因为 det small 和 rec small 模型变大了。
- 该版本目前 仅支持了 ONNXRuntime 和 OpenVINO 两个推理引擎的推理,后续会逐步支持 Paddle, Torch, MNN 和 T ensorRT。
🚀 Features
- feat(python): support PP-OCRv6 (onnxruntime + openvino, det + rec) by @jaminmei in https://github.com/RapidAI/RapidOCR/pull/692
🎉 Contributors
- @jaminmei made their first contribution in https://github.com/RapidAI/RapidOCR/pull/692
Full Changelog: https://github.com/RapidAI/RapidOCR/compare/v3.8.4...v3.9.0
- v3.8.4Release v3.8.42026-06-15 · 2026-06-15 08:49 UTC
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Join our Discord
简体中文 | English
📝 Introduction
RapidOCR is a completely open-source, free OCR tool that supports multi-platform, multi-language operation and rapid offline deployment. Its core advantages lie in extreme speed and extensive compatibility.
Supported Languages: Default support for Chinese and English recognition. For other supported languages, please refer to the documentation: Model List.
Project Origin: Considering that PaddleOCR still has room for optimization in engineering aspects, we innovatively converted the models in PaddleOCR into the highly compatible ONNX format to simplify and accelerate the inference deployment of OCR models on various terminal devices. Furthermore, we achieved seamless cross-platform porting based on multiple programming languages such as Python, C++, Java, and C#, enabling developers to get started easily and integrate efficiently.
Name Implication: The name "RapidOCR" embodies our core expectations for the product: Rapid (simple operation, fast response), Good & Economical (low resource consumption, high cost-effectiveness), and Intelligent (achieving accurate and efficient recognition relying on deep learning technology). We focus on leveraging the advantages of artificial intelligence to create compact yet powerful models, relentlessly pursuing speed while ensuring excellent recognition results.
User Guide:
- Direct Deployment: If the models provided in this repository meet your needs, simply refer to the Official Documentation to quickly complete the deployment and usage of RapidOCR.
- Custom Fine-tuning: If the existing models cannot meet specific scenario requirements, you can fine-tune them using your own data based on PaddleOCR, and then apply the optimized models to the RapidOCR deployment process to achieve personalized customization.
If you find this project helpful for your work or study, we kindly ask you to give us a ⭐ Star to provide valuable support and encouragement!
🎥 Visualization
🛠️ Installation
pip install rapidocr onnxruntime
📋 Usage
from rapidocr import RapidOCR
engine = RapidOCR()
img_url = "https://www.modelscope.cn/models/RapidAI/RapidOCR/resolve/master/resources/test_files/ch_en_num.jpg"
result = engine(img_url)
print(result)
result.vis("vis_result.jpg")
🐳 Docker
Docker development environments are available for all supported inference engines:
# Build and test with ONNX Runtime (CPU)
make build-onnxruntime-cpu
make test-onnxruntime-cpu
# Or use any engine: onnxruntime-gpu, tensorrt, paddle, openvino, pytorch, mnn
make build-tensorrt
make shell-tensorrt
See docker/README.md for full setup instructions, GPU configuration, and troubleshooting.
📚 Documentation
Full documentation can be found on docs, in Chinese.
👥 Who use? (more)
- Docling
- CnOCR
- api-for-open-llm
- arknights-mower
- pensieve
- genshin_artifact_auxiliary
- ChatLLM
- langchain
- Langchain-Chatchat
- JamAIBase
- PAI-RAG
- ChatAgent_RAG
- OpenAdapt
- Umi-OCR
For more projects that use RapidOCR, you are welcome to register at the registration address. Registration is solely for product promotion.
🙏 Acknowledgements
- Many thanks to PaddleOCR for everything.
- Many thanks to PaddleOCR2Pytorch for providing the converted PyTorch format models.
- Many thanks to PaddleX for providing the document models.
- Many thanks to DeliciaLaniD for fixing the misplaced start position of scan animation in ocrweb.
- Many thanks to zhsunlight for the suggestion about parameterized call GPU reasoning and the careful and thoughtful testing.
- Many thanks to lzh111222334 for fixing some bugs of rec preprocessing under python version.
- Many thanks to AutumnSun1996 for the suggestion in the #42.
- Many thanks to DeadWood8 for providing the document which packages rapidocr_web to exe by Nuitka.
- Many thanks to Loovelj for fixing the bug of sorting the text boxes. For details see issue 75.
🤝 Contribution Guide
This repository contains the Python component of RapidOCR. Components for other languages have been migrated to separate repositories.
For the complete workflow on contributing to Python development, please refer to: Python CONTRIBUTING.
🎖 Code Contributors
🌟 Sponsors & Backers
RapidOCR is an Apache2.0-licensed open source project with its ongoing development made possible entirely by the support of these awesome backers. If you'd like to join them, please consider sponsoring RapidOCR's development.
Sponsors
| Sponsors | Application | Introduction |
|---|---|---|
| Quicker | Your fingertip toolbox |
Backers
📜 Citation
If you find this project useful in your research, please consider cite:
@misc{RapidOCR 2021,
title={{Rapid OCR}: OCR Toolbox},
author={RapidAI Team},
howpublished = {\url{https://github.com/RapidAI/RapidOCR}},
year={2021}
}
⭐️ Stargazers over time
⚖️ License
License
Source code
RapidOCR source code and engineering components are copyright RapidOCR Authors and licensed under the Apache License, Version 2.0. See LICENSE.
Models
The bundled and hosted OCR model files are derived from official PaddleOCR models. Copyright in the upstream model weights is held by Baidu and/or the respective PaddleOCR rights holders.
The applicable upstream models are distributed under the Apache License, Version 2.0. Converted model artifacts, including ONNX representations produced by RapidOCR, are redistributed under the same license terms.
RapidOCR does not claim ownership of the upstream model weights. Model-specific sources, hashes, attribution, and conversion information are documented in MODEL_LICENSES.md.