cd lib
chmod +x make.sh
./make.sh
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
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.
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
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