News
- (2021/11/03) Paddle implementation of PAN, see Paddle-PANet. Thanks @simplify23.
- (2021/04/08) PSENet and PAN are included in MMOCR.
Introduction
This repository contains the official implementations of PSENet, PAN, PAN++, and FAST [coming soon].
Text Detection
- PSENet (CVPR'2019)
- PAN (ICCV'2019)
- FAST (Arxiv'2021) [coming soon]
Text Spotting
Installation
First, clone the repository locally:
git clone https://github.com/whai362/pan_pp.pytorch.git
Then, install PyTorch 1.1.0+, torchvision 0.3.0+, and other requirements:
conda install pytorch torchvision -c pytorch
pip install -r requirement.txt
Finally, compile codes of post-processing:
# build pse and pa algorithms
sh ./compile.sh
Dataset
Please refer to dataset/README.md for dataset preparation.
Training
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/pan/pan_r18_ic15.py
Testing
Evaluate the performance
python test.py ${CONFIG_FILE} ${CHECKPOINT_FILE}
cd eval/
./eval_{DATASET}.sh
For example:
python test.py config/pan/pan_r18_ic15.py checkpoints/pan_r18_ic15/checkpoint.pth.tar
cd eval/
./eval_ic15.sh
Evaluate the speed
python test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} --report_speed
For example:
python test.py config/pan/pan_r18_ic15.py checkpoints/pan_r18_ic15/checkpoint.pth.tar --report_speed
Citation
Please cite the related works in your publications if it helps your research:
PSENet
@inproceedings{wang2019shape,
title={Shape Robust Text Detection with Progressive Scale Expansion Network},
author={Wang, Wenhai and Xie, Enze and Li, Xiang and Hou, Wenbo and Lu, Tong and Yu, Gang and Shao, Shuai},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={9336--9345},
year={2019}
}
PAN
@inproceedings{wang2019efficient,
title={Efficient and Accurate Arbitrary-Shaped Text Detection with Pixel Aggregation Network},
author={Wang, Wenhai and Xie, Enze and Song, Xiaoge and Zang, Yuhang and Wang, Wenjia and Lu, Tong and Yu, Gang and Shen, Chunhua},
booktitle={Proceedings of the IEEE International Conference on Computer Vision},
pages={8440--8449},
year={2019}
}
PAN++
@article{wang2021pan++,
title={PAN++: Towards Efficient and Accurate End-to-End Spotting of Arbitrarily-Shaped Text},
author={Wang, Wenhai and Xie, Enze and Li, Xiang and Liu, Xuebo and Liang, Ding and Zhibo, Yang and Lu, Tong and Shen, Chunhua},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
year={2021},
publisher={IEEE}
}
FAST
@misc{chen2021fast,
title={FAST: Searching for a Faster Arbitrarily-Shaped Text Detector with Minimalist Kernel Representation},
author={Zhe Chen and Wenhai Wang and Enze Xie and ZhiBo Yang and Tong Lu and Ping Luo},
year={2021},
eprint={2111.02394},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
License
This project is developed and maintained by IMAGINE [email protected] Key Laboratory for Novel Software Technology, Nanjing University.
This project is released under the Apache 2.0 license.

Epoch: [212 | 600]
(1/198) LR: 0.000677 | Batch: 3.934s | Total: 0min | ETA: 13min | Loss: 0.752 | Loss(text/kernel/emb/rec): 0.493/0.199/0.059/0.000 | IoU(text/kernel): 0.055/0.553 | Acc rec: 0.000
(21/198) LR: 0.000677 | Batch: 1.089s | Total: 0min | ETA: 3min | Loss: 0.731 | Loss(text/kernel/emb/rec): 0.478/0.199/0.054/0.000 | IoU(text/kernel): 0.048/0.482 | Acc rec: 0.000
(41/198) LR: 0.000677 | Batch: 1.022s | Total: 1min | ETA: 3min | Loss: 0.732 | Loss(text/kernel/emb/rec): 0.478/0.198/0.056/0.000 | IoU(text/kernel): 0.049/0.476 | Acc rec: 0.000
这个Acc rec一直是0,我终止训练后,在测试数据上进行测试时,output输出的是空的,请问是怎么回事呢,感谢啦!
Traceback (most recent call last):
File "/home/dell2/anaconda3/envs/pannet/lib/python3.6/multiprocessing/queues.py", line 234, in _feed
obj = _ForkingPickler.dumps(obj)
File "/home/dell2/anaconda3/envs/pannet/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps
cls(buf, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <class 'cPolygon.Error'>: import of module 'cPolygon' failed
似乎是迭代过程中出现的问题且只出现在训练TT数据集的时候
请问出现这种情况该怎样解决呢?谢谢您