Official PyTorch implementation of "CBNet: A Plug-and-Play Network for Segmentation-based Scene Text Detection" in International Journal of Computer Vision (IJCV) 2024.
- (2024/03/21) Code is released.
First, clone the repository locally:
git clone https://github.com/XiiZhao/cbn.pytorch
Then, install PyTorch 1.4.0+, torchvision 0.5.0+, and other requirements:
conda install pytorch torchvision -c pytorch
pip install -r requirement.txt
Finally, for CPP type codes of post-processing:
# build cpp boundary-guided algorithms
cd models/post_processing/bg/
# prepare packages (e.g. pybind11, clipper), set Makefile and compile
make -j12
Please refer to dataset/README.md for dataset preparation.
CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py ${CONFIG_FILE}
For example:
CUDA_VISIBLE_DEVICES=0,1,2,3 python train.py config/cbn/cbn_r18_ctw.py
# single model type:
python test.py ${CONFIG_FILE} ${CHECKPOINT_FILE}
cd eval/
./eval_{DATASET}.sh
# batch modle type:
1) save all model path to a file (e.g. ctw_model.list)
2) sh batchEval.sh ctw_model.list
For example:
python test.py config/cbn/cbn_r18_ctw.py checkpoints/cbn_r18_ctw/checkpoint.pth.tar
cd eval/
./eval_ctw.sh
python test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} --report_speed
For example:
python test.py config/cbn/cbn_r18_ctw.py checkpoints/cbn_r18_ctw/checkpoint.pth.tar --report_speed
This repository is built using the PAN repository, thanks their wonderful work.
If you find our work is useful for your research, please kindly cite our paper.
@article{zhao2024cbnet,
title={CBNet: A Plug-and-Play Network for Segmentation-based Scene Text Detection},
author={Zhao, Xi and Feng, Wei and Zhang, Zheng and Lv, Jingjing and Zhu, Xin and Lin, Zhangang and Hu, Jinghe and Shao, Jingping},
journal={International Journal of Computer Vision},
pages={1--20},
year={2024},
publisher={Springer}
}
If you have any questions, you can submit your issue in this repository, or contact me from the email: xizhao24@yeah.net