Skip to content

Commit 1ffde58

Browse files
committed
refine db docs
1 parent 44ab189 commit 1ffde58

File tree

2 files changed

+93
-6
lines changed

2 files changed

+93
-6
lines changed

doc/doc_ch/algorithm_det_db.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@
4747
### 4.1 Python推理
4848
首先将DB文本检测训练过程中保存的模型,转换成inference model。以基于Resnet50_vd骨干网络,在ICDAR2015英文数据集训练的模型为例( [模型下载地址](https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar) ),可以使用如下命令进行转换:
4949

50-
```
50+
```shell
5151
python3 tools/export_model.py -c configs/det/det_r50_vd_db.yml -o Global.pretrained_model=./det_r50_vd_db_v2.0_train/best_accuracy Global.save_inference_dir=./inference/det_db
5252
```
5353

5454
DB文本检测模型推理,可以执行如下命令:
5555

56-
```
56+
```shell
5757
python3 tools/infer/predict_det.py --image_dir="./doc/imgs_en/img_10.jpg" --det_model_dir="./inference/det_db/"
5858
```
5959

@@ -65,15 +65,20 @@ python3 tools/infer/predict_det.py --image_dir="./doc/imgs_en/img_10.jpg" --det_
6565

6666
<a name="4-2"></a>
6767
### 4.2 C++推理
68-
敬请期待
68+
69+
准备好推理模型后,参考[cpp infer](../../deploy/cpp_infer/)教程进行操作即可。
6970

7071
<a name="4-3"></a>
7172
### 4.3 Serving服务化部署
72-
敬请期待
73+
74+
准备好推理模型后,参考[pdserving](../../deploy/pdserving/)教程进行Serving服务化部署,包括Python Serving和C++ Serving两种模式。
7375

7476
<a name="4-4"></a>
7577
### 4.4 更多推理部署
76-
敬请期待
78+
79+
DB模型还支持以下推理部署方式:
80+
81+
- Paddle2ONNX推理:准备好推理模型后,参考[paddle2onnx](../../deploy/paddle2onnx/)教程操作。
7782

7883
<a name="5"></a>
7984
## 5. FAQ

doc/doc_en/algorithm_det_db_en.md

+83-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,86 @@
1414
- [5. FAQ](#5)
1515

1616
<a name="1"></a>
17-
## 1. Introduction
17+
## 1. Introduction
18+
19+
Paper:
20+
> [Real-time Scene Text Detection with Differentiable Binarization](https://arxiv.org/abs/1911.08947)
21+
> Liao, Minghui and Wan, Zhaoyi and Yao, Cong and Chen, Kai and Bai, Xiang
22+
> AAAI, 2020
23+
24+
On the ICDAR2015 dataset, the text detection result is as follows:
25+
26+
|Model|Backbone|Configuration|Precision|Recall|Hmean|Download|
27+
| --- | --- | --- | --- | --- | --- | --- |
28+
|DB|ResNet50_vd|configs/det/det_r50_vd_db.yml|86.41%|78.72%|82.38%|[trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar)|
29+
|DB|MobileNetV3|configs/det/det_mv3_db.yml|77.29%|73.08%|75.12%|[trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar)|
30+
31+
32+
<a name="2"></a>
33+
## 2. Environment
34+
Please prepare your environment referring to [prepare the environment](./environment_en.md) and [clone the repo](./clone_en.md).
35+
36+
37+
<a name="3"></a>
38+
## 3. Model Training / Evaluation / Prediction
39+
40+
Please refer to [text detection training tutorial](./detection_en.md). PaddleOCR has modularized the code structure, so that you only need to **replace the configuration file** to train different detection models.
41+
42+
<a name="4"></a>
43+
## 4. Inference and Deployment
44+
45+
<a name="4-1"></a>
46+
### 4.1 Python Inference
47+
First, convert the model saved in the DB text detection training process into an inference model. Taking the model based on the Resnet50_vd backbone network and trained on the ICDAR2015 English dataset as example ([model download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar)), you can use the following command to convert:
48+
49+
```shell
50+
python3 tools/export_model.py -c configs/det/det_r50_vd_db.yml -o Global.pretrained_model=./det_r50_vd_db_v2.0_train/best_accuracy Global.save_inference_dir=./inference/det_db
51+
```
52+
53+
DB text detection model inference, you can execute the following command:
54+
55+
```shell
56+
python3 tools/infer/predict_det.py --image_dir="./doc/imgs_en/img_10.jpg" --det_model_dir="./inference/det_db/"
57+
```
58+
59+
The visualized text detection results are saved to the `./inference_results` folder by default, and the name of the result file is prefixed with 'det_res'. Examples of results are as follows:
60+
61+
![](../imgs_results/det_res_img_10_db.jpg)
62+
63+
**Note**: Since the ICDAR2015 dataset has only 1,000 training images, mainly for English scenes, the above model has very poor detection result on Chinese text images.
64+
65+
66+
<a name="4-2"></a>
67+
### 4.2 C++ Inference
68+
69+
With the inference model prepared, refer to the [cpp infer](../../deploy/cpp_infer/) tutorial for C++ inference.
70+
71+
<a name="4-3"></a>
72+
### 4.3 Serving
73+
74+
With the inference model prepared, refer to the [pdserving](../../deploy/pdserving/) tutorial for service deployment by Paddle Serving.
75+
76+
<a name="4-4"></a>
77+
### 4.4 More
78+
79+
More deployment schemes supported for DB:
80+
81+
- Paddle2ONNX: with the inference model prepared, please refer to the [paddle2onnx](../../deploy/paddle2onnx/) tutorial.
82+
83+
<a name="5"></a>
84+
## 5. FAQ
85+
86+
87+
## Citation
88+
89+
```bibtex
90+
@inproceedings{liao2020real,
91+
title={Real-time scene text detection with differentiable binarization},
92+
author={Liao, Minghui and Wan, Zhaoyi and Yao, Cong and Chen, Kai and Bai, Xiang},
93+
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
94+
volume={34},
95+
number={07},
96+
pages={11474--11481},
97+
year={2020}
98+
}
99+
```

0 commit comments

Comments
 (0)