- nms and bbox utils are written in cython, hence you have to build the library first.
cd utils/bbox
chmod +x make.sh
./make.sh
- If demo or train command(shown below) doesn't work than please setup again
- Follow setup to build the library
- Download the ckpt file from googl drive or baidu yun
- Put checkpoints_mlt/ in ctpn_korean/
- Put your images in data/demo, the results will be saved in data/res, and run demo in the root
python ./main/demo.py
- Follow setup to build the library
- Download the ckpt file from googl drive or baidu yun
- Put checkpoints_mlt/ in ctpn_korean/
- Download the pre-trained model of VGG net and put it in data/vgg_16.ckpt. you can download it from tensorflow/models
- Put mlt directory in data/dataset/
- Also, you can prepare your own dataset according to the following steps.
-
Prepare your own dataset(images) in data/dataset/own/image
-
Prepare annotation files(.txt files) in data/dataset/own/label (Annotation file format can be found in gt_img_859.txt. The format is x1,y1(left top),x2,y2(right top),x3,y3(right bottom),x4,y4(left bottom),language tag,object tag. Annotation file's name must be gt_(image).txt)
-
You can make annotation files by following steps
- Using Vgg Image Annotator 1.0.1
- Load images (Image - Load or Add images)
- Boxing objects (Mouse dragging)
- Save json file to data/dataset/own/label (Annotation - Save as Json, do not change file name)
- Convert json to train.txt
python ./data/dataset/own/label/parser.py
- Convert train.txt to annotation files (gt_(image).txt)
python ./data/dataset/own/label/change_cordinate.py
-
Modify the DATA_FOLDER in utils/prepare/split_label.py to data/dataset/own/. And run split_label.py in the root
python ./utils/prepare/split_label.py
- It will generate the prepared data in data/dataset/mlt
-
- Modify parameters(learning rate, max_steps(=epoch), ...) in main/train.py (line 13-24.)
- Because pre-trained weight was saved at 50000, max_steps must be larger than 50000 (The model provided in checkpoints_mlt is trained on GTX1070 for 50k iters. It takes about 0.25s per iter. So it will takes about 3.5 hours to finished 50k iterations.)
python ./main/train.py
- No train logs displayed until the end of training in Window-10 (linux is fine.)