项目链接:https://github.com/eragonruan/text-detection-ctpn
prepare data
1.First, download the pre-trained model of VGG net and put it in data/vgg_16.ckpt. you can download it from tensorflow/models
点击Using pre-trained models:
pre-trained models可供下载:
下载完成后将其置入data/vgg_16.ckpt:
2.Second, download the dataset we prepared from google drive or baidu yun. put the downloaded data in data/dataset/mlt, then start the training.
Also, you can prepare your own dataset according to the following steps.
下载数据集后放入data/dataset/mlt,然后开始训练。此外,您还可以按照以下步骤准备自己的数据集。
Modify the DATA_FOLDER and OUTPUT in utils/prepare/split_label.py according to your dataset. And run split_label.py in the root
python ./utils/prepare/split_label.py
it will generate the prepared data in data/dataset/
首先检查自己的DATA_FOLDER,确保它有两个目录(image,label),在label目录中确保它的标签文本是"gt_IMGNAME.tex",并且它的文本像README中的例子。而在OUTPUT中已经存在dataset/mlt,这是作者已经准备好的txt,不能再次引用。
在OUTPUT中的label与DATA_FOLDER中的label不同:第一个是name,看起来像“IMGNAME.txt”,没有“gt”。第二,它的标签是在原\标签的基础上生成的,并确认其已被修改。所有者的数据类似于(mlt-label和image)。因此我在data/dataset目录下创建了一个my_data目录,其中包括image和label两个目录。引用README中的例子:The input file format demo of split_label.py can be found in gt_img_859.txt. And the output file of split_label.py is img_859.txt. A demo image of the prepared data is shown below.
运行语句:python ./utils/prepare/split_label.py后便可在mlt目录中的image和label中找到image_859.png和image_859.txt.