text-detection-ctpn
Github位址
這是我開源在github上的一個場景文本檢測的模型,主要基于CTPN,可以用來檢測水準的文本,如身份證之類的。詳見github
text detection mainly based on ctpn (connectionist text proposal network). It is implemented in tensorflow. I use id card detect as an example. the origin paper can be found here. Also, the origin repo can be found in here. This repo is mainly based on faster rcnn framework, so there remains tons of useless code. I’m still working on it.
prepare
First, download the pre-trained model of VGG net and put it in data/pretrain/VGG_imagenet.npy. you can download it from google drive.
Second, prepare the training data as referred in paper, or you can download the data I prepared in here. Modify the path and gt_path in prepare_training_data/split_label.py according to your dataset. And run
cd prepare_training_data
python split_label.py
it will generate the prepared data in current folder, and then run
to convert the prepared training data into voc format. It will generate a folder named TEXTVOC. move this folder to data/ and then run
cd ../data
ln -s TEXTVOC VOCdevkit2007
train
Simplely run
you can modify some hyper parameters in ctpn/text.yml, or just used the parameters I set.
demo
put your images in data/demo, the results will be saved in data/results, and run
some results
NOTICE:
all the photos used below are collected from the internet. If it affects you, please contact me to delete them.