trainer/craft/README.md
On the official CRAFT github, there are many people who want to train CRAFT models.
However, the training code is not published in the official CRAFT repository.
There are other reproduced codes, but there is a gap between their performance and performance reported in the original paper. (https://arxiv.org/pdf/1904.01941.pdf)
The trained model with this code recorded a level of performance similar to that of the original paper.
├── config
│ ├── syn_train.yaml
│ └── custom_data_train.yaml
├── data
│ ├── pseudo_label
│ │ ├── make_charbox.py
│ │ └── watershed.py
│ ├── boxEnlarge.py
│ ├── dataset.py
│ ├── gaussian.py
│ ├── imgaug.py
│ └── imgproc.py
├── loss
│ └── mseloss.py
├── metrics
│ └── eval_det_iou.py
├── model
│ ├── craft.py
│ └── vgg16_bn.py
├── utils
│ ├── craft_utils.py
│ ├── inference_boxes.py
│ └── utils.py
├── trainSynth.py
├── train.py
├── train_distributed.py
├── eval.py
├── data_root_dir (place dataset folder here)
└── exp (model and experiment result files will saved here)
Install using pip
pip install -r requirements.txt
└── data_root_dir (you can change root dir in yaml file)
├── ch4_training_images
│ ├── img_1.jpg
│ └── img_2.jpg
├── ch4_training_localization_transcription_gt
│ ├── gt_img_1.txt
│ └── gt_img_2.txt
├── ch4_test_images
│ ├── img_1.jpg
│ └── img_2.jpg
└── ch4_training_localization_transcription_gt
├── gt_img_1.txt
└── gt_img_2.txt
377,117,463,117,465,130,378,130,Genaxis Theatre
493,115,519,115,519,131,493,131,[06]
374,155,409,155,409,170,374,170,###
config folder.)
./exp/[yaml] by default.Step 1 : To train CRAFT with SynthText dataset from scratch
exp/CRAFT_clr_amp_29500.pth and change ckpt_path in the config file according to your local setup.CUDA_VISIBLE_DEVICES=0 python3 trainSynth.py --yaml=syn_train
Step 2 : To train CRAFT with [SynthText + IC15] or custom dataset
CUDA_VISIBLE_DEVICES=0 python3 train.py --yaml=custom_data_train ## if you run on single GPU
CUDA_VISIBLE_DEVICES=0,1 python3 train_distributed.py --yaml=custom_data_train ## if you run on multi GPU
--yaml : configuration file name| Training Dataset | Evaluation Dataset | Precision | Recall | F1-score | pretrained model |
|---|---|---|---|---|---|
| SynthText | ICDAR2013 | 0.801 | 0.748 | 0.773 | <a href="https://drive.google.com/file/d/1enVIsgNvBf3YiRsVkxodspOn55PIK-LJ/view?usp=sharing">download link</a> |
| SynthText + ICDAR2015 | ICDAR2015 | 0.909 | 0.794 | 0.848 | <a href="https://drive.google.com/file/d/1qUeZIDSFCOuGS9yo8o0fi-zYHLEW6lBP/view">download link</a> |