PaddleOCR/doc/doc_ch/algorithm_det_sast.md
2022-04-28 06:39:26 +00:00

3.4 KiB
Raw Blame History

SAST

1. 算法简介

论文信息:

A Single-Shot Arbitrarily-Shaped Text Detector based on Context Attended Multi-Task Learning Wang, Pengfei and Zhang, Chengquan and Qi, Fei and Huang, Zuming and En, Mengyi and Han, Junyu and Liu, Jingtuo and Ding, Errui and Shi, Guangming ACM MM, 2019

在ICDAR2015文本检测公开数据集上算法复现效果如下

模型 骨干网络 配置文件 precision recall Hmean 下载链接
SAST ResNet50_vd configs/det/det_r50_vd_sast_icdar15.yml 91.39% 83.77% 87.42% 训练模型

在Total-text文本检测公开数据集上算法复现效果如下

模型 骨干网络 配置文件 precision recall Hmean 下载链接
SAST ResNet50_vd configs/det/det_r50_vd_sast_totaltext.yml 89.63% 78.44% 83.66% 训练模型

2. 环境配置

请先参考《运行环境准备》配置PaddleOCR运行环境参考《项目克隆》克隆项目代码。

3. 模型训练、评估、预测

请参考文本检测训练教程。PaddleOCR对代码进行了模块化训练不同的检测模型只需要更换配置文件即可。

4. 推理部署

4.1 Python推理

首先将SAST文本检测训练过程中保存的模型转换成inference model。以基于Resnet50_vd骨干网络在ICDAR2015英文数据集训练的模型为例 模型下载地址 ),可以使用如下命令进行转换:

python3 tools/export_model.py -c configs/det/det_r50_vd_sast_icdar15.yml -o Global.pretrained_model=./det_r50_vd_sast_icdar15_v2.0_train/best_accuracy  Global.save_inference_dir=./inference/det_sast

SAST文本检测模型推理可以执行如下命令

python3 tools/infer/predict_det.py --image_dir="./doc/imgs_en/img_10.jpg" --det_model_dir="./inference/det_sast/"

可视化文本检测结果默认保存到./inference_results文件夹里面,结果文件的名称前缀为'det_res'。结果示例如下:

注意由于ICDAR2015数据集只有1000张训练图像且主要针对英文场景所以上述模型对中文文本图像检测效果会比较差。

5. FAQ

引用

@inproceedings{wang2019single,
  title={A Single-Shot Arbitrarily-Shaped Text Detector based on Context Attended Multi-Task Learning},
  author={Wang, Pengfei and Zhang, Chengquan and Qi, Fei and Huang, Zuming and En, Mengyi and Han, Junyu and Liu, Jingtuo and Ding, Errui and Shi, Guangming},
  booktitle={Proceedings of the 27th ACM International Conference on Multimedia},
  pages={1277--1285},
  year={2019}
}