Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
/ CRAFT Public archive

Baek, Youngmin, et al. Character Region Awareness for Text Detection. Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2019. p. 9365-9374.

Notifications You must be signed in to change notification settings

Zerohertz/CRAFT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

conda install pytorch==1.9.1 torchvision==0.10.1 torchaudio==0.9.1 cudatoolkit=11.3 -c pytorch -c conda-forge
pip install wandb==0.12.9
pip install Shapely==1.8.0

train.sh

CUDA_VISIBLE_DEVICES=$CUDA python train.py --yaml=main

test.sh

read -p "Exp: " dir
rm -rf ./exp/$dir
cd utils/cpp_bindings
sh compile.sh
cd ../..

CUDA_VISIBLE_DEVICES=$CUDA python test.py --yaml=org --dir=$dir
cp ./config/main.yaml ./exp/$dir/

Referecne: gmuffiness/CRAFT-train

Read more

CRAFT-train

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
│   ├── ic15_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
├── trainIC15.py
└── eval.py

Training

  1. Write configuration in yaml format
  2. Put the yaml file in the config folder
  3. Run train code (trainSynth.py or trainIC15.py)
  4. Then, experiment results will be saved to ./exp/[yaml] by default.
CUDA_VISIBLE_DEVICES=0,1 python3 trainSynth.py --yaml=syn_train   # run supervision code
CUDA_VISIBLE_DEVICES=0,1 python3 trainIC15.py --yaml=ic15_train   # run weak-supervision code

Arguments

  • --yaml : configuration file name

Evaluation

  • In the official repository issues, the author mentioned that the first row setting F1-score is around 0.75.
  • In the official paper, it is stated that the result F1-score of the second row setting is 0.87.
    • If you adjust post-process parameter 'text_threshold' from 0.85 to 0.75, then F1-score reaches to 0.856.
Training Dataset Evaluation Dataset Precision Recall F1-score pretrained model
SynthText ICDAR2013 0.801 0.748 0.773 download link
SynthText + ICDAR2015 ICDAR2015 0.909 0.794 0.848 download link

About

Baek, Youngmin, et al. Character Region Awareness for Text Detection. Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2019. p. 9365-9374.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages