CNOCR: The test set has the highest accuracy rate of 98%, and a Chinese OCR package with a recognition model
Posted Jun 16, 2020 • 2 min read
Today, Gitee introduces you to a Chinese OCR package. Everyone knows that training a model is a very time-consuming and laborious task, but today this project already comes with a trained recognition model, we only need to download it and use it, it can be said that it is very convenient, then let s go Look at the details of this project.
Project Author: cyahua
Open source license agreement:Apache-2.0
Project address: https://gitee.com/cyahua/cnocr
cnocr is a Python 3 package for Chinese OCR. Cnocr comes with a trained recognition model, which can be used directly after installation.
cnocr is mainly for printed text pictures with simple typesetting, such as screenshot pictures and scanned documents. Cnocr's currently built-in text detection and branching module cannot handle complex text layout positioning. If it is used for scene text picture recognition, it needs to be combined with other scene text detection engines.
Directly usable models
The ocr model of cnocr can be divided into two stages:the first stage is to obtain the local coding vector of the ocr picture, and the second part is to perform sequence learning on the local coding vector to obtain the sequence coding vector. The current two stages include the following models:
- Local coding model(emb model)
conv:multi-layer convolutional network;
conv-lite:smaller multi-layer convolution network;
- Sequence coding model(seq model)
lstm:two-layer LSTM network;
gru:two-layer GRU network;
fc:Two-layer fully connected network.
cnocr currently contains the following models that can be used directly. The trained models are all placed in the cnocr-models project, which can be downloaded for free:
The initial code for this project forks from crnn-mxnet-chinese-text-recognition, thanks to the author.
But the source project is not convenient enough to use, so I did some packaging and refactoring on this basis. The main changes are as follows:
- No longer need to install MXNet WarpCTC Loss, and use native MXNet CTC Loss instead. So the installation is minimal!
- Comes with a trained Chinese OCR recognition model. No additional training is required!
- Added prediction(or inference) interface. So easy to use!
If you are interested in this project and want to try the effect of recognition in person, you can click on the link at the back to go to the project homepage to see it. If you feel good, please give it a Star: https://gitee.com/cyahua /cnocr