Git Product home page Git Product logo

ocr-standard's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.