`onnxocr-ppocrv5` is a Python library providing an ONNX-based inference pipeline for Baidu's PP-OCRv5. It aims for efficient optical character recognition by leveraging ONNX Runtime for high-performance inference. The current version is 0.0.14, and releases appear to be infrequent, typically focusing on specific model updates or bug fixes.
pip install onnxocr-ppocrv5Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the `OnnxOCR` model and perform OCR on a local image file. The model automatically downloads necessary ONNX files on the first run, which requires an internet connection and sufficient disk space.
Ensure an active internet connection and sufficient disk space for model storage (~500 MB). The models are cached locally for subsequent runs.
To enable GPU inference: `pip uninstall onnxruntime` then `pip install onnxruntime-gpu` (ensure you have compatible CUDA drivers and toolkit installed).
Pin the exact version in your `requirements.txt` (`onnxocr-ppocrv5==0.0.14`) for production environments. Regularly check the GitHub repository for updates and release notes.
Always verify that the image path exists and points to a valid, supported image file (e.g., JPG, PNG, BMP). Use `os.path.exists()` for paths.