Skip to content

csjiangwm/OCR-standard

Repository files navigation

CTPN+CRNN_pytorch/DenseNet_keras+CTC for Chinese character recognition

Deployment

cd lib
chmod +x make.sh
./make.sh

Test

Download the CTPN model from BaiduyunDisk with extract code: "48j2"
Download the CRNN model from BaiduyunDisk with extract code: "2yww"
Or download the DenseNet model from BaiduyunDisk with extract code: "uafx"
If you want to detect the text direction and rotate your image, you should download the VGG model from BaiduyunDisk with extract code: "ass4". Note that this VGG model can only detect 0, 90, 180, 270 degrees.

python ctpn_crnn.py --CTPN_MODEL your_ctpn_path \
		    --CRNN_MODEL your_crnn_path \
		    --VGG_MODEL your_vgg_path \
		    --ADJUST_ANGLE your_choice

Or

python ctpn_densenet.py --CTPN_MODEL your_ctpn_path \
			--DENSENET_MODEL your_densenet_path \
			--VGG_MODEL your_vgg_path \
			--ADJUST_ANGLE your_choice

Some results


Detected result

CRNN result

DenseNet result

It can be seen that the method can achieve a good performance in Chinese character recognition, but achieve a bad performance in numeric character and English character. Training data is the main reason for this result. So you may want to train your own model.

Train CTPN

Download the training dataset from BaiduyunDisk with extract code: "45g7"
Download the pretrained CTPN model from BaiduyunDisk with extract code: "jsp4"

python CTPN_train.py --PRETRAINED_MODEL your_path \
		     --DATA_DIR your_data_path \
		     --SAVED_PATH the_path_you_want_to_save_your_model \
		     --CTPN_LOGGER your_logger_path

Train DenseNet

Download the training dataset from BaiduyunDisk with extract code: "uqic"

python DenseNet_train.py --PRETRAINED_MODEL your_path \
		     --DATA_DIR your_data_path \
		     --SAVED_PATH the_path_you_want_to_save_your_model \
		     --CTPN_LOGGER your_logger_path

Reference

End

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages