https://github.com/avafly/paddleocr-ncnn-cpp
C++ implementations of PP-OCRv3 and PP-OCRv5 using ncnn for inference.
https://github.com/avafly/paddleocr-ncnn-cpp
cpp crnn db deep-learning ncnn ocr paddleocr
Last synced: 3 months ago
JSON representation
C++ implementations of PP-OCRv3 and PP-OCRv5 using ncnn for inference.
- Host: GitHub
- URL: https://github.com/avafly/paddleocr-ncnn-cpp
- Owner: Avafly
- License: mit
- Created: 2025-08-23T03:07:58.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-10-23T01:47:45.000Z (5 months ago)
- Last Synced: 2025-10-23T03:30:14.258Z (5 months ago)
- Topics: cpp, crnn, db, deep-learning, ncnn, ocr, paddleocr
- Language: C++
- Homepage:
- Size: 290 KB
- Stars: 19
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This repository provides C++ implementations of PP-OCRv3 and PP-OCRv5, inspired by the official [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) project and using [ncnn](https://github.com/Tencent/ncnn) for inference.
The Release page contains a complete project archive that includes resources like models (v3 & v5) and images required to run the demo.
## Demo
## Usage
```bash
./main ../config.json ../images/ocr_img1.png
```
## Requirements
* OpenCV 4.10.0
* ncnn 20241226
* OpenMP 3.0+
## Benchmarks
I ran benchmarks on a RPi 4B using `ocr_img1.png` (simple) and `ocr_img3.png` (complex). You can find those images inside the release page `archive.tar.gz`.
| Models | Latency / Peak memory for ocr_img1 | Latency / Peak memory for ocr_img3 |
| :------: | :--------------------------------: | :--------------------------------: |
| PP-OCRv3 | 387.80 ms / 101.3 MB | 5213.68 ms / 273.6 MB |
| PP-OCRv5 | 387.05 ms / 98.95 MB | 6740.93 ms / 335.7 MB |
## Notes
Enabling FP16 may be faster but can cause NaN results on some devices. Edit `config.json` to enable or disable FP16.
## Implementation References
https://github.com/MhLiao/DB
https://github.com/nihui/ncnn-android-ppocrv5
https://github.com/FeiGeChuanShu/ncnn_paddleocr
https://github.com/PaddlePaddle/PaddleOCR