opencv/text_recognition_crnn
By opencv · ↓ 0 · ♥ 1 · Updated 2025-06-20
What's in this repo
This page lists the files in opencv/text_recognition_crnn, including text_recognition_CRNN_CH_2021sep.onnx, text_recognition_CRNN_CH_2021sep_int8bq.onnx, text_recognition_CRNN_CH_2022oct_int8.onnx and more.
- 10 ONNX models (.onnx files)
- 22 files, including 10 .onnx, 3 .py, 1 .txt, 1 .md, 1 .h, 1 .cpp
- Last updated 2025-06-20
ONNX files
| File | Size | Download |
|---|---|---|
| text_recognition_CRNN_CH_2021sep.onnx | — | Download |
| text_recognition_CRNN_CH_2021sep_int8bq.onnx | — | Download |
| text_recognition_CRNN_CH_2022oct_int8.onnx | — | Download |
| text_recognition_CRNN_CH_2023feb_fp16.onnx | — | Download |
| text_recognition_CRNN_CN_2021nov.onnx | — | Download |
| text_recognition_CRNN_CN_2021nov_int8.onnx | — | Download |
| text_recognition_CRNN_CN_2021nov_int8bq.onnx | — | Download |
| text_recognition_CRNN_EN_2021sep.onnx | — | Download |
| text_recognition_CRNN_EN_2022oct_int8.onnx | — | Download |
| text_recognition_CRNN_EN_2023feb_fp16.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
CRNN
Results of accuracy evaluation with tools/eval at different text recognition datasets.
| Model name | ICDAR03(%) | IIIT5k(%) | CUTE80(%) |
|---|---|---|---|
| CRNN_EN | 81.66 | 74.33 | 52.78 |
| CRNN_EN_FP16 | 82.01 | 74.93 | 52.34 |
| CRNN_EN_INT8 | 81.75 | 75.33 | 52.43 |
| CRNN_CH | 71.28 | 80.90 | 67.36 |
| CRNN_CH_FP16 | 78.63 | 80.93 | 67.01 |
| CRNN_CH_INT8 | 78.11 | 81.20 | 67.01 |
*: 'FP16' or 'INT8' stands for 'model quantized into FP16' or 'model quantized into int8'
Note:
- Model source:
text_recognition_CRNN_EN_2021sep.onnx: https://docs.opencv.org/4.5.2/d9/d1e/tutorial_dnn_OCR.html (CRNN_VGG_BiLSTM_CTC.onnx)text_recognition_CRNN_CH_2021sep.onnx: https://docs.opencv.org/4.x/d4/d43/tutorial_dnn_text_spotting.html (crnn_cs.onnx)text_recognition_CRNN_CN_2021nov.onnx: https://docs.opencv.org/4.5.2/d4/d43/tutorial_dnn_text_spotting.html (crnn_cs_CN.onnx)
text_recognition_CRNN_EN_2021sep.onnxcan detect digits (0~9) and letters (return lowercase letters a~z) (seeCHARSET_EN_36for details incrnn.py).text_recognition_CRNN_CH_2021sep.onnxcan detect digits (0~9), upper/lower-case letters (a~z and A~Z), and some special characters (seeCHARSET_CH_94for details incrnn.py).text_recognition_CRNN_CN_2021nov.onnxcan detect digits (0~9), upper/lower-case letters (a~z and A~Z), some Chinese characters and some special characters (seeCHARSET_CN_3944for details incrnn.py).- For details on training this model series, please visit https://github.com/zihaomu/deep-text-recognition-benchmark.
text_recognition_CRNN_XX_2021xxx_int8bq.onnxrepresents the block-quantized version in int8 precision and is generated using block_quantize.py withblock_size=64.
Demo
NOTE:
- This demo uses text_detection_db as text detector.
Python
Run the demo detecting English:
# detect on camera input
python demo.py
# detect on an image
python demo.py --input /path/to/image -v
# get help regarding various parameters
python demo.py --help
Run the demo detecting Chinese:
# detect on camera input
python demo.py --model text_recognition_CRNN_CN_2021nov.onnx
# detect on an image
python demo.py --input /path/to/image --model text_recognition_CRNN_CN_2021nov.onnx
# get help regarding various parameters
python demo.py --help
C++
Install latest OpenCV and CMake >= 3.24.0 to get started with:
# detect on camera input
./build/opencv_zoo_text_recognition_crnn
# detect on an image
./build/opencv_zoo_text_recognition_crnn --input /path/to/image -v
# get help regarding various parameters
./build/opencv_zoo_text_recognition_crnn --help
Run the demo detecting Chinese:
# detect on camera input
./build/opencv_zoo_text_recognition_crnn --model=text_recognition_CRNN_CN_2021nov.onnx --charset=charset_3944_CN.txt
# detect on an image
./build/opencv_zoo_text_recognition_crnn --input=/path/to/image --model=text_recognition_CRNN_CN_2021nov.onnx --charset=charset_3944_CN.txt
# get help regarding various parameters
./build/opencv_zoo_text_recognition_crnn --help
Examples


License
All files in this directory are licensed under Apache 2.0 License.
Reference
- https://arxiv.org/abs/1507.05717
- https://github.com/bgshih/crnn
- https://github.com/meijieru/crnn.pytorch
- https://github.com/zihaomu/deep-text-recognition-benchmark
- https://docs.opencv.org/4.5.2/d9/d1e/tutorial_dnn_OCR.html
Model info
Created: 2025-06-09
Updated: 2025-06-20
View on Hugging FaceFiles (22)
Related models
More from opencv
More models
No task type declared.