RapidOCR-ONNXRuntime is a Python library providing cross-platform Optical Character Recognition (OCR) capabilities, leveraging the ONNX Runtime inference engine for high-speed and efficient offline deployments. It converts PaddleOCR models to the ONNX format, offering a performant solution for text recognition. The library supports multiple programming languages, with its Python interface primarily integrated into the broader RapidOCR ecosystem. The current PyPI version is 1.4.4, released in January 2025, and the associated GitHub project is actively maintained with frequent updates.
pip install rapidocr-onnxruntimeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the RapidOCR engine and perform OCR on an image. The `RapidOCR` class handles model loading and inference using the ONNX Runtime backend provided by `rapidocr-onnxruntime`. The example downloads an image from a URL, processes it, and prints the detected text along with bounding box information.
Always install `rapidocr-onnxruntime` if you intend to use the ONNX Runtime backend, and import the `RapidOCR` class from the `rapidocr` package for typical usage. Refer to the official RapidOCR GitHub documentation for the most current usage patterns.
Explicitly install `onnxruntime-gpu` for GPU inference (e.g., `pip install rapidocr-onnxruntime onnxruntime-gpu`). For optimal performance, especially on Windows, consider the specific `onnxruntime` variant that best suits your hardware.
Consult the RapidOCR documentation's 'Model List' and 'User Guide' sections for details on supported languages and the process for integrating custom or additional language models.
If text detection speed is critical and appears to be a bottleneck, consider experimenting with different `onnxruntime` configurations (e.g., thread counts) or evaluating alternative OCR engines, especially if migrating from PaddleOCR.