```
-#### 1.1 自定义数据集
+### 1.1 自定义数据集
下面以通用数据集为例, 介绍如何准备数据集:
* 训练集
@@ -82,16 +82,16 @@ train_data/rec/train/word_002.jpg 用科技让复杂的世界更简单
-1.2 数据下载
+### 1.2 数据下载
-若您本地没有数据集,可以在官网下载 [icdar2015](http://rrc.cvc.uab.es/?ch=4&com=downloads) 数据,用于快速验证。也可以参考[DTRB](https://github.com/clovaai/deep-text-recognition-benchmark#download-lmdb-dataset-for-traininig-and-evaluation-from-here) ,下载 benchmark 所需的lmdb格式数据集。
+- ICDAR2015
-如果你使用的是icdar2015的公开数据集,PaddleOCR 提供了一份用于训练 icdar2015 数据集的标签文件,通过以下方式下载:
-
-如果希望复现SRN的论文指标,需要下载离线[增广数据](https://pan.baidu.com/s/1-HSZ-ZVdqBF2HaBZ5pRAKA),提取码: y3ry。增广数据是由MJSynth和SynthText做旋转和扰动得到的。数据下载完成后请解压到 {your_path}/PaddleOCR/train_data/data_lmdb_release/training/ 路径下。
+若您本地没有数据集,可以在官网下载 [ICDAR2015](http://rrc.cvc.uab.es/?ch=4&com=downloads) 数据,用于快速验证。也可以参考[DTRB](https://github.com/clovaai/deep-text-recognition-benchmark#download-lmdb-dataset-for-traininig-and-evaluation-from-here) ,下载 benchmark 所需的lmdb格式数据集。
如果希望复现SAR的论文指标,需要下载[SynthAdd](https://pan.baidu.com/share/init?surl=uV0LtoNmcxbO-0YA7Ch4dg), 提取码:627x。此外,真实数据集icdar2013, icdar2015, cocotext, IIIT5也作为训练数据的一部分。具体数据细节可以参考论文SAR。
+如果你使用的是icdar2015的公开数据集,PaddleOCR 提供了一份用于训练 ICDAR2015 数据集的标签文件,通过以下方式下载:
+
```
# 训练集标签
wget -P ./train_data/ic15_data https://paddleocr.bj.bcebos.com/dataset/rec_gt_train.txt
@@ -99,15 +99,25 @@ wget -P ./train_data/ic15_data https://paddleocr.bj.bcebos.com/dataset/rec_gt_t
wget -P ./train_data/ic15_data https://paddleocr.bj.bcebos.com/dataset/rec_gt_test.txt
```
-PaddleOCR 也提供了数据格式转换脚本,可以将官网 label 转换支持的数据格式。 数据转换工具在 `ppocr/utils/gen_label.py`, 这里以训练集为例:
+PaddleOCR 也提供了数据格式转换脚本,可以将ICDAR官网 label 转换为PaddleOCR支持的数据格式。 数据转换工具在 `ppocr/utils/gen_label.py`, 这里以训练集为例:
```
# 将官网下载的标签文件转换为 rec_gt_label.txt
python gen_label.py --mode="rec" --input_path="{path/of/origin/label}" --output_label="rec_gt_label.txt"
```
+数据样式格式如下,(a)为原始图片,(b)为每张图片对应的 Ground Truth 文本文件:
+![](../datasets/icdar_rec.png)
+
+- 多语言数据集
+
+多语言模型的训练数据集均为100w的合成数据,使用了开源合成工具 [text_renderer](https://github.com/Sanster/text_renderer) ,少量的字体可以通过下面两种方式下载。
+* [百度网盘](https://pan.baidu.com/s/1bS_u207Rm7YbY33wOECKDA) 提取码:frgi
+* [google drive](https://drive.google.com/file/d/18cSWX7wXSy4G0tbKJ0d9PuIaiwRLHpjA/view)
+
+
-1.3 字典
+### 1.3 字典
最后需要提供一个字典({word_dict_name}.txt),使模型在训练时,可以将所有出现的字符映射为字典的索引。
@@ -154,13 +164,27 @@ PaddleOCR内置了一部分字典,可以按需使用。
并将 `character_type` 设置为 `ch`。
-1.4 添加空格类别
+### 1.4 添加空格类别
如果希望支持识别"空格"类别, 请将yml文件中的 `use_space_char` 字段设置为 `True`。
-### 2. 启动训练
+## 2. 启动训练
+
+
+### 2.1 数据增强
+
+PaddleOCR提供了多种数据增强方式,默认配置文件中已经添加了数据增广。
+
+默认的扰动方式有:颜色空间转换(cvtColor)、模糊(blur)、抖动(jitter)、噪声(Gasuss noise)、随机切割(random crop)、透视(perspective)、颜色反转(reverse)、TIA数据增广。
+
+训练过程中每种扰动方式以40%的概率被选择,具体代码实现请参考:[rec_img_aug.py](../../ppocr/data/imaug/rec_img_aug.py)
+
+*由于OpenCV的兼容性问题,扰动操作暂时只支持Linux*
+
+
+### 2.2 通用模型训练
PaddleOCR提供了训练脚本、评估脚本和预测脚本,本节将以 CRNN 识别模型为例:
@@ -180,23 +204,16 @@ tar -xf rec_mv3_none_bilstm_ctc_v2.0_train.tar && rm -rf rec_mv3_none_bilstm_ctc
*如果您安装的是cpu版本,请将配置文件中的 `use_gpu` 字段修改为false*
```
-# GPU训练 支持单卡,多卡训练,通过--gpus参数指定卡号
+# GPU训练 支持单卡,多卡训练
# 训练icdar15英文数据 训练日志会自动保存为 "{save_model_dir}" 下的train.log
-python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/rec/rec_icdar15_train.yml
-```
-
-#### 2.1 数据增强
-
-PaddleOCR提供了多种数据增强方式,默认配置文件中已经添加了数据增广。
-
-默认的扰动方式有:颜色空间转换(cvtColor)、模糊(blur)、抖动(jitter)、噪声(Gasuss noise)、随机切割(random crop)、透视(perspective)、颜色反转(reverse)、TIA数据增广。
-训练过程中每种扰动方式以40%的概率被选择,具体代码实现请参考:[rec_img_aug.py](../../ppocr/data/imaug/rec_img_aug.py)
+#单卡训练(训练周期长,不建议)
+python3 tools/train.py -c configs/rec/rec_icdar15_train.yml
-*由于OpenCV的兼容性问题,扰动操作暂时只支持Linux*
+#多卡训练,通过--gpus参数指定卡号
+python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/rec/rec_icdar15_train.yml
+```
-
-#### 2.2 训练
PaddleOCR支持训练和评估交替进行, 可以在 `configs/rec/rec_icdar15_train.yml` 中修改 `eval_batch_step` 设置评估频率,默认每500个iter评估一次。评估过程中默认将最佳acc模型,保存为 `output/rec_CRNN/best_accuracy` 。
@@ -286,85 +303,12 @@ Eval:
```
**注意,预测/评估时的配置文件请务必与训练一致。**
-
-#### 2.3 小语种
+
+### 2.3 多语言模型训练
PaddleOCR目前已支持80种(除中文外)语种识别,`configs/rec/multi_languages` 路径下提供了一个多语言的配置文件模版: [rec_multi_language_lite_train.yml](../../configs/rec/multi_language/rec_multi_language_lite_train.yml)。
-您有两种方式创建所需的配置文件:
-
-1. 通过脚本自动生成
-
-[generate_multi_language_configs.py](../../configs/rec/multi_language/generate_multi_language_configs.py) 可以帮助您生成多语言模型的配置文件
-
-- 以意大利语为例,如果您的数据是按如下格式准备的:
- ```
- |-train_data
- |- it_train.txt # 训练集标签
- |- it_val.txt # 验证集标签
- |- data
- |- word_001.jpg
- |- word_002.jpg
- |- word_003.jpg
- | ...
- ```
-
- 可以使用默认参数,生成配置文件:
-
- ```bash
- # 该代码需要在指定目录运行
- cd PaddleOCR/configs/rec/multi_language/
- # 通过-l或者--language参数设置需要生成的语种的配置文件,该命令会将默认参数写入配置文件
- python3 generate_multi_language_configs.py -l it
- ```
-
-- 如果您的数据放置在其他位置,或希望使用自己的字典,可以通过指定相关参数来生成配置文件:
-
- ```bash
- # -l或者--language字段是必须的
- # --train修改训练集,--val修改验证集,--data_dir修改数据集目录,--dict修改字典路径, -o修改对应默认参数
- cd PaddleOCR/configs/rec/multi_language/
- python3 generate_multi_language_configs.py -l it \ # 语种
- --train {path/of/train_label.txt} \ # 训练标签文件的路径
- --val {path/of/val_label.txt} \ # 验证集标签文件的路径
- --data_dir {train_data/path} \ # 训练数据的根目录
- --dict {path/of/dict} \ # 字典文件路径
- -o Global.use_gpu=False # 是否使用gpu
- ...
-
- ```
-
-意大利文由拉丁字母组成,因此执行完命令后会得到名为 rec_latin_lite_train.yml 的配置文件。
-
-2. 手动修改配置文件
-
- 您也可以手动修改模版中的以下几个字段:
-
- ```
- Global:
- use_gpu: True
- epoch_num: 500
- ...
- character_type: it # 需要识别的语种
- character_dict_path: {path/of/dict} # 字典文件所在路径
-
- Train:
- dataset:
- name: SimpleDataSet
- data_dir: train_data/ # 数据存放根目录
- label_file_list: ["./train_data/train_list.txt"] # 训练集label路径
- ...
-
- Eval:
- dataset:
- name: SimpleDataSet
- data_dir: train_data/ # 数据存放根目录
- label_file_list: ["./train_data/val_list.txt"] # 验证集label路径
- ...
-
- ```
-
-目前PaddleOCR支持的多语言算法有:
+按语系划分,目前PaddleOCR支持的语种有:
| 配置文件 | 算法名称 | backbone | trans | seq | pred | language | character_type |
| :--------: | :-------: | :-------: | :-------: | :-----: | :-----: | :-----: | :-----: |
@@ -381,10 +325,6 @@ PaddleOCR目前已支持80种(除中文外)语种识别,`configs/rec/multi
更多支持语种请参考: [多语言模型](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_ch/multi_languages.md#%E8%AF%AD%E7%A7%8D%E7%BC%A9%E5%86%99)
-多语言模型训练方式与中文模型一致,训练数据集均为100w的合成数据,少量的字体可以通过下面两种方式下载。
-* [百度网盘](https://pan.baidu.com/s/1bS_u207Rm7YbY33wOECKDA)。提取码:frgi。
-* [google drive](https://drive.google.com/file/d/18cSWX7wXSy4G0tbKJ0d9PuIaiwRLHpjA/view)
-
如您希望在现有模型效果的基础上调优,请参考下列说明修改配置文件:
以 `rec_french_lite_train` 为例:
@@ -420,7 +360,7 @@ Eval:
...
```
-### 3 评估
+## 3 评估
评估数据集可以通过 `configs/rec/rec_icdar15_train.yml` 修改Eval中的 `label_file_path` 设置。
@@ -430,14 +370,29 @@ python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/rec
```
-### 4 预测
-
-
-#### 4.1 训练引擎的预测
+## 4 预测
使用 PaddleOCR 训练好的模型,可以通过以下脚本进行快速预测。
-默认预测图片存储在 `infer_img` 里,通过 `-o Global.checkpoints` 指定权重:
+默认预测图片存储在 `infer_img` 里,通过 `-o Global.checkpoints` 加载训练好的参数文件:
+
+根据配置文件中设置的的 `save_model_dir` 和 `save_epoch_step` 字段,会有以下几种参数被保存下来:
+
+```
+output/rec/
+├── best_accuracy.pdopt
+├── best_accuracy.pdparams
+├── best_accuracy.states
+├── config.yml
+├── iter_epoch_3.pdopt
+├── iter_epoch_3.pdparams
+├── iter_epoch_3.states
+├── latest.pdopt
+├── latest.pdparams
+├── latest.states
+└── train.log
+```
+其中 best_accuracy.* 是评估集上的最优模型;iter_epoch_x.* 是以 `save_epoch_step` 为间隔保存下来的模型;latest.* 是最后一个epoch的模型。
```
# 预测英文结果
diff --git a/doc/doc_ch/training.md b/doc/doc_ch/training.md
new file mode 100644
index 0000000000000000000000000000000000000000..fb7f94a9e86cf392421ab6ed6f99cf2d49390096
--- /dev/null
+++ b/doc/doc_ch/training.md
@@ -0,0 +1,131 @@
+# 模型训练
+
+本文将介绍模型训练时需掌握的基本概念,和训练时的调优方法。
+
+同时会简单介绍PaddleOCR模型训练数据的组成部分,以及如何在垂类场景中准备数据finetune模型。
+
+- [1. 基本概念](#基本概念)
+ * [1.1 学习率](#学习率)
+ * [1.2 正则化](#正则化)
+ * [1.3 评估指标](#评估指标)
+- [2. 数据与垂类场景](#数据与垂类场景)
+ * [2.1 训练数据](#训练数据)
+ * [2.2 垂类场景](#垂类场景)
+ * [2.3 自己构建数据集](#自己构建数据集)
+* [3. 常见问题](#常见问题)
+
+
+## 1. 基本概念
+
+OCR(Optical Character Recognition,光学字符识别)是指对图像进行分析识别处理,获取文字和版面信息的过程,是典型的计算机视觉任务,
+通常由文本检测和文本识别两个子任务构成。
+
+模型调优时需要关注以下参数:
+
+
+### 1.1 学习率
+
+学习率是训练神经网络的重要超参数之一,它代表在每一次迭代中梯度向损失函数最优解移动的步长。
+在PaddleOCR中提供了多种学习率更新策略,可以通过配置文件修改,例如:
+
+```
+Optimizer:
+ ...
+ lr:
+ name: Piecewise
+ decay_epochs : [700, 800]
+ values : [0.001, 0.0001]
+ warmup_epoch: 5
+```
+
+Piecewise 代表分段常数衰减,在不同的学习阶段指定不同的学习率,在每段内学习率相同。
+warmup_epoch 代表在前5个epoch中,学习率将逐渐从0增加到base_lr。全部策略可以参考代码[learning_rate.py](../../ppocr/optimizer/learning_rate.py) 。
+
+
+### 1.2 正则化
+
+正则化可以有效的避免算法过拟合,PaddleOCR中提供了L1、L2正则方法,L1 和 L2 正则化是最常用的正则化方法。L1 正则化向目标函数添加正则化项,以减少参数的绝对值总和;而 L2 正则化中,添加正则化项的目的在于减少参数平方的总和。配置方法如下:
+
+```
+Optimizer:
+ ...
+ regularizer:
+ name: L2
+ factor: 2.0e-05
+```
+
+
+### 1.3 评估指标
+
+(1)检测阶段:先按照检测框和标注框的IOU评估,IOU大于某个阈值判断为检测准确。这里检测框和标注框不同于一般的通用目标检测框,是采用多边形进行表示。检测准确率:正确的检测框个数在全部检测框的占比,主要是判断检测指标。检测召回率:正确的检测框个数在全部标注框的占比,主要是判断漏检的指标。
+
+(2)识别阶段: 字符识别准确率,即正确识别的文本行占标注的文本行数量的比例,只有整行文本识别对才算正确识别。
+
+(3)端到端统计: 端对端召回率:准确检测并正确识别文本行在全部标注文本行的占比; 端到端准确率:准确检测并正确识别文本行在 检测到的文本行数量 的占比; 准确检测的标准是检测框与标注框的IOU大于某个阈值,正确识别的的检测框中的文本与标注的文本相同。
+
+
+
+## 2. 数据与垂类场景
+
+
+### 2.1 训练数据
+目前开源的模型,数据集和量级如下:
+
+ - 检测:
+ - 英文数据集,ICDAR2015
+ - 中文数据集,LSVT街景数据集训练数据3w张图片
+
+ - 识别:
+ - 英文数据集,MJSynth和SynthText合成数据,数据量上千万。
+ - 中文数据集,LSVT街景数据集根据真值将图crop出来,并进行位置校准,总共30w张图像。此外基于LSVT的语料,合成数据500w。
+ - 小语种数据集,使用不同语料和字体,分别生成了100w合成数据集,并使用ICDAR-MLT作为验证集。
+
+其中,公开数据集都是开源的,用户可自行搜索下载,也可参考[中文数据集](./datasets.md),合成数据暂不开源,用户可使用开源合成工具自行合成,可参考的合成工具包括[text_renderer](https://github.com/Sanster/text_renderer) 、[SynthText](https://github.com/ankush-me/SynthText) 、[TextRecognitionDataGenerator](https://github.com/Belval/TextRecognitionDataGenerator) 等。
+
+
+### 2.2 垂类场景
+
+PaddleOCR主要聚焦通用OCR,如果有垂类需求,您可以用PaddleOCR+垂类数据自己训练;
+如果缺少带标注的数据,或者不想投入研发成本,建议直接调用开放的API,开放的API覆盖了目前比较常见的一些垂类。
+
+
+### 2.3 自己构建数据集
+
+在构建数据集时有几个经验可供参考:
+
+(1) 训练集的数据量:
+
+ a. 检测需要的数据相对较少,在PaddleOCR模型的基础上进行Fine-tune,一般需要500张可达到不错的效果。
+ b. 识别分英文和中文,一般英文场景需要几十万数据可达到不错的效果,中文则需要几百万甚至更多。
+
+
+(2)当训练数据量少时,可以尝试以下三种方式获取更多的数据:
+
+ a. 人工采集更多的训练数据,最直接也是最有效的方式。
+ b. 基于PIL和opencv基本图像处理或者变换。例如PIL中ImageFont, Image, ImageDraw三个模块将文字写到背景中,opencv的旋转仿射变换,高斯滤波等。
+ c. 利用数据生成算法合成数据,例如pix2pix或StyleText等算法。
+
+
+
+## 3. 常见问题
+
+**Q**:训练CRNN识别时,如何选择合适的网络输入shape?
+
+ A:一般高度采用32,最长宽度的选择,有两种方法:
+
+ (1)统计训练样本图像的宽高比分布。最大宽高比的选取考虑满足80%的训练样本。
+
+ (2)统计训练样本文字数目。最长字符数目的选取考虑满足80%的训练样本。然后中文字符长宽比近似认为是1,英文认为3:1,预估一个最长宽度。
+
+**Q**:识别训练时,训练集精度已经到达90了,但验证集精度一直在70,涨不上去怎么办?
+
+ A:训练集精度90,测试集70多的话,应该是过拟合了,有两个可尝试的方法:
+
+ (1)加入更多的增广方式或者调大增广prob的[概率](https://github.com/PaddlePaddle/PaddleOCR/blob/dygraph/ppocr/data/imaug/rec_img_aug.py#L341),默认为0.4。
+
+ (2)调大系统的[l2 dcay值](https://github.com/PaddlePaddle/PaddleOCR/blob/a501603d54ff5513fc4fc760319472e59da25424/configs/rec/ch_ppocr_v1.1/rec_chinese_lite_train_v1.1.yml#L47)
+
+**Q**: 识别模型训练时,loss能正常下降,但acc一直为0
+
+ A:识别模型训练初期acc为0是正常的,多训一段时间指标就上来了。
+
diff --git a/doc/doc_ch/update.md b/doc/doc_ch/update.md
index 3fe8a0c9ace4be31882b22fe75b88f18848e1ad9..0852e240886b4ca736a830c8c44651ca35ec1f25 100644
--- a/doc/doc_ch/update.md
+++ b/doc/doc_ch/update.md
@@ -1,4 +1,8 @@
# 更新
+- 2021.9.7 发布PaddleOCR v2.3,发布[PP-OCRv2](#PP-OCRv2),CPU推理速度相比于PP-OCR server提升220%;效果相比于PP-OCR mobile 提升7%。
+- 2021.8.3 发布PaddleOCR v2.2,新增文档结构分析[PP-Structure](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.2/ppstructure/README_ch.md)工具包,支持版面分析与表格识别(含Excel导出)。
+- 2021.6.29 [FAQ](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.2/doc/doc_ch/FAQ.md)新增5个高频问题,总数248个,每周一都会更新,欢迎大家持续关注。
+- 2021.4.8 release 2.1版本,新增AAAI 2021论文[端到端识别算法PGNet](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.2/doc/doc_ch/pgnet.md)开源,[多语言模型](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.2/doc/doc_ch/multi_languages.md)支持种类增加到80+。
- 2020.12.15 更新数据合成工具[Style-Text](../../StyleText/README_ch.md),可以批量合成大量与目标场景类似的图像,在多个场景验证,效果明显提升。
- 2020.12.07 [FAQ](../../doc/doc_ch/FAQ.md)新增5个高频问题,总数124个,并且计划以后每周一都会更新,欢迎大家持续关注。
- 2020.11.25 更新半自动标注工具[PPOCRLabel](../../PPOCRLabel/README_ch.md),辅助开发者高效完成标注任务,输出格式与PP-OCR训练任务完美衔接。
diff --git a/doc/doc_ch/visualization.md b/doc/doc_ch/visualization.md
index f2ea2b09d9431ebd710f2d7ccac0bd73c50b558e..99d071ec22daccaa295b5087760c5fc0d45f9802 100644
--- a/doc/doc_ch/visualization.md
+++ b/doc/doc_ch/visualization.md
@@ -1,7 +1,13 @@
# 效果展示
+
+## 超轻量PP-OCRv2效果展示
+
+
+
+
-## 通用ppocr_server_2.0 效果展示
+## 通用PP-OCR server 效果展示
diff --git a/doc/doc_ch/whl.md b/doc/doc_ch/whl.md
index 167ed7b2b8a13706dfe1533265b6d96560265511..ba5bbae6255382d0c7fa5be319946d6242b1a544 100644
--- a/doc/doc_ch/whl.md
+++ b/doc/doc_ch/whl.md
@@ -210,7 +210,7 @@ paddleocr --image_dir PaddleOCR/doc/imgs/11.jpg --use_angle_cls true
```bash
[[[24.0, 36.0], [304.0, 34.0], [304.0, 72.0], [24.0, 74.0]], ['纯臻营养护发素', 0.964739]]
[[[24.0, 80.0], [172.0, 80.0], [172.0, 104.0], [24.0, 104.0]], ['产品信息/参数', 0.98069626]]
-[[[24.0, 109.0], [333.0, 109.0], [333.0, 136.0], [24.0, 136.0]], ['(45元/每公斤,100公斤起订)', 0.9676722]]
+[[[24.0, 109.0], [333.0, 109.0], [333.0, 136.0], [24.0, 136.0]], ['(45元/每公斤,100公斤起订)', 0.9676722]]µ
......
```
diff --git a/doc/doc_en/config_en.md b/doc/doc_en/config_en.md
index 5e5847c4b298553b2d376b90196b61b7e0286efe..4ac6758ff642a58e265e12a0be8308d1fb8251c0 100644
--- a/doc/doc_en/config_en.md
+++ b/doc/doc_en/config_en.md
@@ -51,7 +51,7 @@ Take rec_chinese_lite_train_v2.0.yml as an example
### Architecture ([ppocr/modeling](../../ppocr/modeling))
-In ppocr, the network is divided into four stages: Transform, Backbone, Neck and Head
+In PaddleOCR, the network is divided into four stages: Transform, Backbone, Neck and Head
| Parameter | Use | Defaults | Note |
| :---------------------: | :---------------------: | :--------------: | :--------------------: |
@@ -120,3 +120,108 @@ In ppocr, the network is divided into four stages: Transform, Backbone, Neck and
| batch_size_per_card | Single card batch size during training | 256 | \ |
| drop_last | Whether to discard the last incomplete mini-batch because the number of samples in the data set cannot be divisible by batch_size | True | \ |
| num_workers | The number of sub-processes used to load data, if it is 0, the sub-process is not started, and the data is loaded in the main process | 8 | \ |
+
+
+## 3. MULTILINGUAL CONFIG FILE GENERATION
+
+PaddleOCR currently supports 80 (except Chinese) language recognition. A multi-language configuration file template is
+provided under the path `configs/rec/multi_languages`: [rec_multi_language_lite_train.yml](../../configs/rec/multi_language/rec_multi_language_lite_train.yml)。
+
+There are two ways to create the required configuration file::
+
+1. Automatically generated by script
+
+[generate_multi_language_configs.py](../../configs/rec/multi_language/generate_multi_language_configs.py) Can help you generate configuration files for multi-language models
+
+- Take Italian as an example, if your data is prepared in the following format:
+ ```
+ |-train_data
+ |- it_train.txt # train_set label
+ |- it_val.txt # val_set label
+ |- data
+ |- word_001.jpg
+ |- word_002.jpg
+ |- word_003.jpg
+ | ...
+ ```
+
+ You can use the default parameters to generate a configuration file:
+
+ ```bash
+ # The code needs to be run in the specified directory
+ cd PaddleOCR/configs/rec/multi_language/
+ # Set the configuration file of the language to be generated through the -l or --language parameter.
+ # This command will write the default parameters into the configuration file
+ python3 generate_multi_language_configs.py -l it
+ ```
+
+- If your data is placed in another location, or you want to use your own dictionary, you can generate the configuration file by specifying the relevant parameters:
+
+ ```bash
+ # -l or --language field is required
+ # --train to modify the training set
+ # --val to modify the validation set
+ # --data_dir to modify the data set directory
+ # --dict to modify the dict path
+ # -o to modify the corresponding default parameters
+ cd PaddleOCR/configs/rec/multi_language/
+ python3 generate_multi_language_configs.py -l it \ # language
+ --train {path/of/train_label.txt} \ # path of train_label
+ --val {path/of/val_label.txt} \ # path of val_label
+ --data_dir {train_data/path} \ # root directory of training data
+ --dict {path/of/dict} \ # path of dict
+ -o Global.use_gpu=False # whether to use gpu
+ ...
+
+ ```
+Italian is made up of Latin letters, so after executing the command, you will get the rec_latin_lite_train.yml.
+
+2. Manually modify the configuration file
+
+ You can also manually modify the following fields in the template:
+
+ ```
+ Global:
+ use_gpu: True
+ epoch_num: 500
+ ...
+ character_type: it # language
+ character_dict_path: {path/of/dict} # path of dict
+
+ Train:
+ dataset:
+ name: SimpleDataSet
+ data_dir: train_data/ # root directory of training data
+ label_file_list: ["./train_data/train_list.txt"] # train label path
+ ...
+
+ Eval:
+ dataset:
+ name: SimpleDataSet
+ data_dir: train_data/ # root directory of val data
+ label_file_list: ["./train_data/val_list.txt"] # val label path
+ ...
+
+ ```
+
+
+Currently, the multi-language algorithms supported by PaddleOCR are:
+
+| Configuration file | Algorithm name | backbone | trans | seq | pred | language | character_type |
+| :--------: | :-------: | :-------: | :-------: | :-----: | :-----: | :-----: | :-----: |
+| rec_chinese_cht_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | chinese traditional | chinese_cht|
+| rec_en_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | English(Case sensitive) | EN |
+| rec_french_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | French | french |
+| rec_ger_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | German | german |
+| rec_japan_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | Japanese | japan |
+| rec_korean_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | Korean | korean |
+| rec_latin_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | Latin | latin |
+| rec_arabic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | arabic | ar |
+| rec_cyrillic_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | cyrillic | cyrillic |
+| rec_devanagari_lite_train.yml | CRNN | Mobilenet_v3 small 0.5 | None | BiLSTM | ctc | devanagari | devanagari |
+
+For more supported languages, please refer to : [Multi-language model](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_en/multi_languages_en.md#4-support-languages-and-abbreviations)
+
+The multi-language model training method is the same as the Chinese model. The training data set is 100w synthetic data. A small amount of fonts and test data can be downloaded using the following two methods.
+* [Baidu Netdisk](https://pan.baidu.com/s/1bS_u207Rm7YbY33wOECKDA),Extraction code:frgi.
+* [Google drive](https://drive.google.com/file/d/18cSWX7wXSy4G0tbKJ0d9PuIaiwRLHpjA/view)
diff --git a/doc/doc_en/detection_en.md b/doc/doc_en/detection_en.md
index b736beb55d79db02bf4d4301a74c685537fce249..8f12d42fe798de7d330f1d3ef1950325887525cb 100644
--- a/doc/doc_en/detection_en.md
+++ b/doc/doc_en/detection_en.md
@@ -1,10 +1,32 @@
-# TEXT DETECTION
+# CONTENT
+
+- [Paste Your Document In Here](#paste-your-document-in-here)
+- [1. TEXT DETECTION](#1-text-detection)
+ * [1.1 DATA PREPARATION](#11-data-preparation)
+ * [1.2 DOWNLOAD PRETRAINED MODEL](#12-download-pretrained-model)
+ * [1.3 START TRAINING](#13-start-training)
+ * [1.4 LOAD TRAINED MODEL AND CONTINUE TRAINING](#14-load-trained-model-and-continue-training)
+ * [1.5 TRAINING WITH NEW BACKBONE](#15-training-with-new-backbone)
+ * [1.6 EVALUATION](#16-evaluation)
+ * [1.7 TEST](#17-test)
+ * [1.8 INFERENCE MODEL PREDICTION](#18-inference-model-prediction)
+- [2. FAQ](#2-faq)
+
+
+# 1. TEXT DETECTION
This section uses the icdar2015 dataset as an example to introduce the training, evaluation, and testing of the detection model in PaddleOCR.
-## DATA PREPARATION
+## 1.1 DATA PREPARATION
The icdar2015 dataset can be obtained from [official website](https://rrc.cvc.uab.es/?ch=4&com=downloads). Registration is required for downloading.
+
+After registering and logging in, download the part marked in the red box in the figure below. And, the content downloaded by `Training Set Images` should be saved as the folder `icdar_c4_train_imgs`, and the content downloaded by `Test Set Images` is saved as the folder `ch4_test_images`
+
+
+
+
+
Decompress the downloaded dataset to the working directory, assuming it is decompressed under PaddleOCR/train_data/. In addition, PaddleOCR organizes many scattered annotation files into two separate annotation files for train and test respectively, which can be downloaded by wget:
```shell
# Under the PaddleOCR path
@@ -36,10 +58,11 @@ The `points` in the dictionary represent the coordinates (x, y) of the four poin
If you want to train PaddleOCR on other datasets, please build the annotation file according to the above format.
-## TRAINING
+## 1.2 DOWNLOAD PRETRAINED MODEL
+
+First download the pretrained model. The detection model of PaddleOCR currently supports 3 backbones, namely MobileNetV3, ResNet18_vd and ResNet50_vd. You can use the model in [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.0/ppcls/modeling/architectures) to replace backbone according to your needs.
+And the responding download link of backbone pretrain weights can be found in (https://github.com/PaddlePaddle/PaddleClas/blob/release%2F2.0/README_cn.md#resnet%E5%8F%8A%E5%85%B6vd%E7%B3%BB%E5%88%97).
-First download the pretrained model. The detection model of PaddleOCR currently supports 3 backbones, namely MobileNetV3, ResNet18_vd and ResNet50_vd. You can use the model in [PaddleClas](https://github.com/PaddlePaddle/PaddleClas/tree/develop/ppcls/modeling/architectures) to replace backbone according to your needs.
-And the responding download link of backbone pretrain weights can be found in [PaddleClas repo](https://github.com/PaddlePaddle/PaddleClas#mobile-series).
```shell
cd PaddleOCR/
# Download the pre-trained model of MobileNetV3
@@ -49,11 +72,13 @@ wget -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dyg
# or, download the pre-trained model of ResNet50_vd
wget -P ./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNet50_vd_ssld_pretrained.pdparams
+```
-#### START TRAINING
+## 1.3 START TRAINING
*If CPU version installed, please set the parameter `use_gpu` to `false` in the configuration.*
```shell
-python3 tools/train.py -c configs/det/det_mv3_db.yml
+python3 tools/train.py -c configs/det/det_mv3_db.yml \
+ -o Global.pretrain_weights=./pretrain_models/MobileNetV3_large_x0_5_pretrained
```
In the above instruction, use `-c` to select the training to use the `configs/det/det_db_mv3.yml` configuration file.
@@ -62,16 +87,17 @@ For a detailed explanation of the configuration file, please refer to [config](.
You can also use `-o` to change the training parameters without modifying the yml file. For example, adjust the training learning rate to 0.0001
```shell
# single GPU training
-python3 tools/train.py -c configs/det/det_mv3_db.yml -o Optimizer.base_lr=0.0001
+python3 tools/train.py -c configs/det/det_mv3_db.yml -o \
+ Global.pretrain_weights=./pretrain_models/MobileNetV3_large_x0_5_pretrained \
+ Optimizer.base_lr=0.0001
# multi-GPU training
# Set the GPU ID used by the '--gpus' parameter.
-python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/det/det_mv3_db.yml -o Optimizer.base_lr=0.0001
-
+python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/det/det_mv3_db.yml -o Global.pretrain_weights=./pretrain_models/MobileNetV3_large_x0_5_pretrained
```
-#### load trained model and continue training
+## 1.4 LOAD TRAINED MODEL AND CONTINUE TRAINING
If you expect to load trained model and continue the training again, you can specify the parameter `Global.checkpoints` as the model path to be loaded.
For example:
@@ -82,9 +108,59 @@ python3 tools/train.py -c configs/det/det_mv3_db.yml -o Global.checkpoints=./you
**Note**: The priority of `Global.checkpoints` is higher than that of `Global.pretrain_weights`, that is, when two parameters are specified at the same time, the model specified by `Global.checkpoints` will be loaded first. If the model path specified by `Global.checkpoints` is wrong, the one specified by `Global.pretrain_weights` will be loaded.
-## EVALUATION
+## 1.5 TRAINING WITH NEW BACKBONE
+
+The network part completes the construction of the network, and PaddleOCR divides the network into four parts, which are under [ppocr/modeling](../../ppocr/modeling). The data entering the network will pass through these four parts in sequence(transforms->backbones->
+necks->heads).
+
+```bash
+├── architectures # Code for building network
+├── transforms # Image Transformation Module
+├── backbones # Feature extraction module
+├── necks # Feature enhancement module
+└── heads # Output module
+```
+
+If the Backbone to be replaced has a corresponding implementation in PaddleOCR, you can directly modify the parameters in the `Backbone` part of the configuration yml file.
+
+However, if you want to use a new Backbone, an example of replacing the backbones is as follows:
+
+1. Create a new file under the [ppocr/modeling/backbones](../../ppocr/modeling/backbones) folder, such as my_backbone.py.
+2. Add code in the my_backbone.py file, the sample code is as follows:
+
+```python
+import paddle
+import paddle.nn as nn
+import paddle.nn.functional as F
+
+
+class MyBackbone(nn.Layer):
+ def __init__(self, *args, **kwargs):
+ super(MyBackbone, self).__init__()
+ # your init code
+ self.conv = nn.xxxx
+
+ def forward(self, inputs):
+ # your network forward
+ y = self.conv(inputs)
+ return y
+```
+
+3. Import the added module in the [ppocr/modeling/backbones/\__init\__.py](../../ppocr/modeling/backbones/__init__.py) file.
+
+After adding the four-part modules of the network, you only need to configure them in the configuration file to use, such as:
+
+```yaml
+ Backbone:
+ name: MyBackbone
+ args1: args1
+```
+
+**NOTE**: More details about replace Backbone and other mudule can be found in [doc](add_new_algorithm_en.md).
+
+## 1.6 EVALUATION
-PaddleOCR calculates three indicators for evaluating performance of OCR detection task: Precision, Recall, and Hmean.
+PaddleOCR calculates three indicators for evaluating performance of OCR detection task: Precision, Recall, and Hmean(F-Score).
Run the following code to calculate the evaluation indicators. The result will be saved in the test result file specified by `save_res_path` in the configuration file `det_db_mv3.yml`
@@ -95,10 +171,9 @@ The model parameters during training are saved in the `Global.save_model_dir` di
python3 tools/eval.py -c configs/det/det_mv3_db.yml -o Global.checkpoints="{path/to/weights}/best_accuracy" PostProcess.box_thresh=0.6 PostProcess.unclip_ratio=1.5
```
+* Note: `box_thresh` and `unclip_ratio` are parameters required for DB post-processing, and not need to be set when evaluating the EAST and SAST model.
-* Note: `box_thresh` and `unclip_ratio` are parameters required for DB post-processing, and not need to be set when evaluating the EAST model.
-
-## TEST
+## 1.7 TEST
Test the detection result on a single image:
```shell
@@ -107,7 +182,7 @@ python3 tools/infer_det.py -c configs/det/det_mv3_db.yml -o Global.infer_img="./
When testing the DB model, adjust the post-processing threshold:
```shell
-python3 tools/infer_det.py -c configs/det/det_mv3_db.yml -o Global.infer_img="./doc/imgs_en/img_10.jpg" Global.pretrained_model="./output/det_db/best_accuracy" PostProcess.box_thresh=0.6 PostProcess.unclip_ratio=1.5
+python3 tools/infer_det.py -c configs/det/det_mv3_db.yml -o Global.infer_img="./doc/imgs_en/img_10.jpg" Global.pretrained_model="./output/det_db/best_accuracy" PostProcess.box_thresh=0.6 PostProcess.unclip_ratio=2.0
```
@@ -115,3 +190,33 @@ Test the detection result on all images in the folder:
```shell
python3 tools/infer_det.py -c configs/det/det_mv3_db.yml -o Global.infer_img="./doc/imgs_en/" Global.pretrained_model="./output/det_db/best_accuracy"
```
+
+## 1.8 INFERENCE MODEL PREDICTION
+
+The inference model (the model saved by `paddle.jit.save`) is generally a solidified model saved after the model training is completed, and is mostly used to give prediction in deployment.
+
+The model saved during the training process is the checkpoints model, which saves the parameters of the model and is mostly used to resume training.
+
+Compared with the checkpoints model, the inference model will additionally save the structural information of the model. Therefore, it is easier to deploy because the model structure and model parameters are already solidified in the inference model file, and is suitable for integration with actual systems.
+
+Firstly, we can convert DB trained model to inference model:
+```shell
+python3 tools/export_model.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model="./output/det_db/best_accuracy" Global.save_inference_dir="./output/det_db_inference/"
+```
+
+The detection inference model prediction:
+```shell
+python3 tools/infer/predict_det.py --det_algorithm="DB" --det_model_dir="./output/det_db_inference/" --image_dir="./doc/imgs/" --use_gpu=True
+```
+
+If it is other detection algorithms, such as the EAST, the det_algorithm parameter needs to be modified to EAST, and the default is the DB algorithm:
+```shell
+python3 tools/infer/predict_det.py --det_algorithm="EAST" --det_model_dir="./output/det_db_inference/" --image_dir="./doc/imgs/" --use_gpu=True
+```
+
+# 2. FAQ
+
+Q1: The prediction results of trained model and inference model are inconsistent?
+**A**: Most of the problems are caused by the inconsistency of the pre-processing and post-processing parameters during the prediction of the trained model and the pre-processing and post-processing parameters during the prediction of the inference model. Taking the model trained by the det_mv3_db.yml configuration file as an example, the solution to the problem of inconsistent prediction results between the training model and the inference model is as follows:
+- Check whether the [trained model preprocessing](https://github.com/PaddlePaddle/PaddleOCR/blob/c1ed243fb68d5d466258243092e56cbae32e2c14/configs/det/det_mv3_db.yml#L116) is consistent with the prediction [preprocessing function of the inference model](https://github.com/PaddlePaddle/PaddleOCR/blob/c1ed243fb68d5d466258243092e56cbae32e2c14/tools/infer/predict_det.py#L42). When the algorithm is evaluated, the input image size will affect the accuracy. In order to be consistent with the paper, the image is resized to [736, 1280] in the training icdar15 configuration file, but there is only a set of default parameters when the inference model predicts, which will be considered To predict the speed problem, the longest side of the image is limited to 960 for resize by default. The preprocessing function of the training model preprocessing and the inference model is located in [ppocr/data/imaug/operators.py](https://github.com/PaddlePaddle/PaddleOCR/blob/c1ed243fb68d5d466258243092e56cbae32e2c14/ppocr/data/imaug/operators.py#L147)
+- Check whether the [post-processing of the trained model](https://github.com/PaddlePaddle/PaddleOCR/blob/c1ed243fb68d5d466258243092e56cbae32e2c14/configs/det/det_mv3_db.yml#L51) is consistent with the [post-processing parameters of the inference](https://github.com/PaddlePaddle/PaddleOCR/blob/c1ed243fb68d5d466258243092e56cbae32e2c14/tools/infer/utility.py#L50).
diff --git a/doc/doc_en/environment_en.md b/doc/doc_en/environment_en.md
new file mode 100644
index 0000000000000000000000000000000000000000..96a46cce3010934689e8d95985ca434f49d18886
--- /dev/null
+++ b/doc/doc_en/environment_en.md
@@ -0,0 +1,332 @@
+# Environment Preparation
+
+* [1. Python Environment Setup](#1)
+ + [1.1 Windows](#1.1)
+ + [1.2 Mac](#1.2)
+ + [1.3 Linux](#1.3)
+* [2. Install PaddlePaddle 2.0](#2)
+
+
+
+## 1. Python Environment Setup
+
+
+
+### 1.1 Windows
+
+#### 1.1.1 Install Anaconda
+
+- Note: To use paddlepaddle you need to install python environment first, here we choose python integrated environment Anaconda toolkit
+
+ - Anaconda is a common python package manager
+ - After installing Anaconda, you can install the python environment, as well as numpy and other required toolkit environment.
+
+- Anaconda download.
+
+ - Address: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D
+
+ - Most Win10 computers are 64-bit operating systems, choose x86_64 version; if the computer is a 32-bit operating system, choose x86.exe
+
+
+
+ - After the download is complete, double-click the installer to enter the graphical interface
+
+ - The default installation location is C drive, it is recommended to change the installation location to D drive.
+
+
+
+ - Check conda to add environment variables and ignore the warning that
+
+
+
+
+#### 1.1.2 Opening the terminal and creating the conda environment
+
+- Open Anaconda Prompt terminal: bottom left Windows Start Menu -> Anaconda3 -> Anaconda Prompt start console
+
+
+
+
+- Create a new conda environment
+
+ ```shell
+ # Enter the following command at the command line to create an environment named paddle_env
+ # Here to speed up the download, use the Tsinghua source
+ conda create --name paddle_env python=3.8 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ # This is a one line command
+ ```
+
+ This command will create an executable environment named paddle_env with python version 3.8, which will take a while depending on the network status
+
+ The command line will then output a prompt, type y and enter to continue the installation
+
+
+
+- To activate the conda environment you just created, enter the following command at the command line.
+
+ ```shell
+ # Activate the paddle_env environment
+ conda activate paddle_env
+ # View the current location of python
+ where python
+ ```
+
+
+
+The above anaconda environment and python environment are installed
+
+
+
+
+
+### 1.2 Mac
+
+#### 1.2.1 Installing Anaconda
+
+- Note: To use paddlepaddle you need to install the python environment first, here we choose the python integrated environment Anaconda toolkit
+
+ - Anaconda is a common python package manager
+ - After installing Anaconda, you can install the python environment, as well as numpy and other required toolkit environment
+
+- Anaconda download:.
+
+ - Address: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D
+
+
+
+ - Select `Anaconda3-2021.05-MacOSX-x86_64.pkg` at the bottom to download
+
+- After downloading, double click on the .pkg file to enter the graphical interface
+
+ - Just follow the default settings, it will take a while to install
+
+- It is recommended to install a code editor such as vscode or pycharm
+
+#### 1.2.2 Open a terminal and create a conda environment
+
+- Open the terminal
+
+ - Press command and spacebar at the same time, type "terminal" in the focus search, double click to enter terminal
+
+- **Add conda to the environment variables**
+
+ - Environment variables are added so that the system can recognize the conda command
+
+ - Open `~/.bash_profile` in the terminal by typing the following command.
+
+ ```shell
+ vim ~/.bash_profile
+ ```
+
+ - Add conda as an environment variable in `~/.bash_profile`.
+
+ ```shell
+ # Press i first to enter edit mode
+ # In the first line type.
+ export PATH="~/opt/anaconda3/bin:$PATH"
+ # If you customized the installation location during installation, change ~/opt/anaconda3/bin to the bin folder in the customized installation directory
+ ```
+
+ ```shell
+ # The modified ~/.bash_profile file should look like this (where xxx is the username)
+ export PATH="~/opt/anaconda3/bin:$PATH"
+ # >>> conda initialize >>>
+ # !!! Contents within this block are managed by 'conda init' !!!
+ __conda_setup="$('/Users/xxx/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
+ if [ $? -eq 0 ]; then
+ eval "$__conda_setup"
+ else
+ if [ -f "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" ]; then
+ . "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh"
+ else
+ export PATH="/Users/xxx/opt/anaconda3/bin:$PATH"
+ fi
+ fi
+ unset __conda_setup
+ # <<< conda initialize <<<
+ ```
+
+ - When you are done, press `esc` to exit edit mode, then type `:wq!` and enter to save and exit
+
+ - Verify that the conda command is recognized.
+
+ - Enter `source ~/.bash_profile` in the terminal to update the environment variables
+ - Enter `conda info --envs` in the terminal again, if it shows that there is a base environment, then conda has been added to the environment variables
+
+- Create a new conda environment
+
+ ```shell
+ # Enter the following command at the command line to create an environment called paddle_env
+ # Here to speed up the download, use Tsinghua source
+ conda create --name paddle_env python=3.8 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
+ ```
+
+ - This command will create an executable environment named paddle_env with python version 3.8, which will take a while depending on the network status
+
+ - The command line will then output a prompt, type y and enter to continue the installation
+
+ -
+
+- To activate the conda environment you just created, enter the following command at the command line.
+
+ ```shell
+ # Activate the paddle_env environment
+ conda activate paddle_env
+ # View the current location of python
+ where python
+ ```
+
+
+
+The above anaconda environment and python environment are installed
+
+
+
+
+
+### 1.3 Linux
+
+Linux users can choose to run either Anaconda or Docker. If you are familiar with Docker and need to train the PaddleOCR model, it is recommended to use the Docker environment, where the development process of PaddleOCR is run. If you are not familiar with Docker, you can also use Anaconda to run the project.
+
+#### 1.3.1 Anaconda environment configuration
+
+- Note: To use paddlepaddle you need to install the python environment first, here we choose the python integrated environment Anaconda toolkit
+
+ - Anaconda is a common python package manager
+ - After installing Anaconda, you can install the python environment, as well as numpy and other required toolkit environment
+
+- **Download Anaconda**.
+
+ - Download at: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D
+
+
+
+
+
+
+ - Select the appropriate version for your operating system
+ - Type `uname -m` in the terminal to check the command set used by your system
+
+ - Download method 1: Download locally, then transfer the installation package to the linux server
+
+ - Download method 2: Directly use linux command line to download
+
+ ```shell
+ # First install wget
+ sudo apt-get install wget # Ubuntu
+ sudo yum install wget # CentOS
+ ```
+ ```bash
+ # Then use wget to download from Tsinghua source
+ # If you want to download Anaconda3-2021.05-Linux-x86_64.sh, the download command is as follows
+ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.05-Linux-x86_64.sh
+ # If you want to download another version, you need to change the file name after the last 1 / to the version you want to download
+ ```
+
+- To install Anaconda.
+
+ - Type `sh Anaconda3-2021.05-Linux-x86_64.sh` at the command line
+ - If you downloaded a different version, replace the file name of the command with the name of the file you downloaded
+ - Just follow the installation instructions
+ - You can exit by typing q when viewing the license
+
+- **Add conda to the environment variables**
+
+ - If you have already added conda to the environment variable path during the installation, you can skip this step
+
+ - Open `~/.bashrc` in a terminal.
+
+ ```shell
+ # Enter the following command in the terminal.
+ vim ~/.bashrc
+ ```
+
+ - Add conda as an environment variable in `~/.bashrc`.
+
+ ```shell
+ # Press i first to enter edit mode # In the first line enter.
+ export PATH="~/anaconda3/bin:$PATH"
+ # If you customized the installation location during installation, change ~/anaconda3/bin to the bin folder in the customized installation directory
+ ```
+
+ ```shell
+ # The modified ~/.bash_profile file should look like this (where xxx is the username)
+ export PATH="~/opt/anaconda3/bin:$PATH"
+ # >>> conda initialize >>>
+ # !!! Contents within this block are managed by 'conda init' !!!
+ __conda_setup="$('/Users/xxx/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
+ if [ $? -eq 0 ]; then
+ eval "$__conda_setup"
+ else
+ if [ -f "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" ]; then
+ . "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh"
+ else
+ export PATH="/Users/xxx/opt/anaconda3/bin:$PATH"
+ fi
+ fi
+ unset __conda_setup
+ # <<< conda initialize <<<
+ ```
+
+ - When you are done, press `esc` to exit edit mode, then type `:wq!` and enter to save and exit
+
+ - Verify that the conda command is recognized.
+
+ - Enter `source ~/.bash_profile` in the terminal to update the environment variables
+ - Enter `conda info --envs` in the terminal again, if it shows that there is a base environment, then conda has been added to the environment variables
+
+- Create a new conda environment
+
+ ```shell
+ # Enter the following command at the command line to create an environment called paddle_env
+ # Here to speed up the download, use Tsinghua source
+ conda create --name paddle_env python=3.8 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
+ ```
+
+ - This command will create an executable environment named paddle_env with python version 3.8, which will take a while depending on the network status
+
+ - The command line will then output a prompt, type y and enter to continue the installation
+
+
+
+- To activate the conda environment you just created, enter the following command at the command line.
+
+ ```shell
+ # Activate the paddle_env environment
+ conda activate paddle_env
+ ```
+
+The above anaconda environment and python environment are installed
+
+
+#### 1.3.2 Docker environment preparation
+
+**The first time you use this docker image, it will be downloaded automatically. Please be patient.**
+
+```bash
+# Switch to the working directory
+cd /home/Projects
+# You need to create a docker container for the first run, and do not need to run the current command when you run it again
+# Create a docker container named ppocr and map the current directory to the /paddle directory of the container
+
+# If using CPU, use docker instead of nvidia-docker to create docker
+sudo docker run --name ppocr -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82 /bin/bash
+```
+
+
+
+## 2. Install PaddlePaddle 2.0
+
+- If you have cuda9 or cuda10 installed on your machine, please run the following command to install
+
+```bash
+python3 -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple
+```
+
+- If you only have cpu on your machine, please run the following command to install
+
+```bash
+python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
+```
+
+For more software version requirements, please refer to the instructions in [Installation Document](https://www.paddlepaddle.org.cn/install/quick) for operation.
+
diff --git a/doc/doc_en/inference_ppocr_en.md b/doc/doc_en/inference_ppocr_en.md
new file mode 100755
index 0000000000000000000000000000000000000000..5442d0c578027c33890fbb063a0d2c78ecd226c5
--- /dev/null
+++ b/doc/doc_en/inference_ppocr_en.md
@@ -0,0 +1,135 @@
+
+# Reasoning based on Python prediction engine
+
+This article introduces the use of the Python inference engine for the PP-OCR model library. The content is in order of text detection, text recognition, direction classifier and the prediction method of the three in series on the CPU and GPU.
+
+
+- [TEXT DETECTION MODEL INFERENCE](#DETECTION_MODEL_INFERENCE)
+
+- [TEXT RECOGNITION MODEL INFERENCE](#RECOGNITION_MODEL_INFERENCE)
+ - [1. LIGHTWEIGHT CHINESE MODEL](#LIGHTWEIGHT_RECOGNITION)
+ - [2. MULTILINGUAL MODEL INFERENCE](MULTILINGUAL_MODEL_INFERENCE)
+
+- [ANGLE CLASSIFICATION MODEL INFERENCE](#ANGLE_CLASS_MODEL_INFERENCE)
+
+- [TEXT DETECTION ANGLE CLASSIFICATION AND RECOGNITION INFERENCE CONCATENATION](#CONCATENATION)
+
+
+
+## TEXT DETECTION MODEL INFERENCE
+
+The default configuration is based on the inference setting of the DB text detection model. For lightweight Chinese detection model inference, you can execute the following commands:
+
+```
+# download DB text detection inference model
+wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar
+tar xf ch_ppocr_mobile_v2.0_det_infer.tar
+# predict
+python3 tools/infer/predict_det.py --image_dir="./doc/imgs/00018069.jpg" --det_model_dir="./inference/det_db/"
+```
+
+The visual 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:
+
+![](../imgs_results/det_res_00018069.jpg)
+
+You can use the parameters `limit_type` and `det_limit_side_len` to limit the size of the input image,
+The optional parameters of `limit_type` are [`max`, `min`], and
+`det_limit_size_len` is a positive integer, generally set to a multiple of 32, such as 960.
+
+The default setting of the parameters is `limit_type='max', det_limit_side_len=960`. Indicates that the longest side of the network input image cannot exceed 960,
+If this value is exceeded, the image will be resized with the same width ratio to ensure that the longest side is `det_limit_side_len`.
+Set as `limit_type='min', det_limit_side_len=960`, it means that the shortest side of the image is limited to 960.
+
+If the resolution of the input picture is relatively large and you want to use a larger resolution prediction, you can set det_limit_side_len to the desired value, such as 1216:
+```
+python3 tools/infer/predict_det.py --image_dir="./doc/imgs/1.jpg" --det_model_dir="./inference/det_db/" --det_limit_type=max --det_limit_side_len=1216
+```
+
+If you want to use the CPU for prediction, execute the command as follows
+```
+python3 tools/infer/predict_det.py --image_dir="./doc/imgs/1.jpg" --det_model_dir="./inference/det_db/" --use_gpu=False
+```
+
+
+
+## TEXT RECOGNITION MODEL INFERENCE
+
+
+
+### 1. LIGHTWEIGHT CHINESE TEXT RECOGNITION MODEL REFERENCE
+
+For lightweight Chinese recognition model inference, you can execute the following commands:
+
+```
+# download CRNN text recognition inference model
+wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar
+tar xf ch_ppocr_mobile_v2.0_rec_infer.tar
+python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_10.png" --rec_model_dir="ch_ppocr_mobile_v2.0_rec_infer"
+```
+
+![](../imgs_words_en/word_10.png)
+
+After executing the command, the prediction results (recognized text and score) of the above image will be printed on the screen.
+
+```bash
+Predicts of ./doc/imgs_words_en/word_10.png:('PAIN', 0.9897658)
+```
+
+
+
+### 2. MULTILINGAUL MODEL INFERENCE
+If you need to predict other language models, when using inference model prediction, you need to specify the dictionary path used by `--rec_char_dict_path`. At the same time, in order to get the correct visualization results,
+You need to specify the visual font path through `--vis_font_path`. There are small language fonts provided by default under the `doc/fonts` path, such as Korean recognition:
+
+```
+python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words/korean/1.jpg" --rec_model_dir="./your inference model" --rec_char_type="korean" --rec_char_dict_path="ppocr/utils/dict/korean_dict.txt" --vis_font_path="doc/fonts/korean.ttf"
+```
+![](../imgs_words/korean/1.jpg)
+
+After executing the command, the prediction result of the above figure is:
+
+``` text
+Predicts of ./doc/imgs_words/korean/1.jpg:('바탕으로', 0.9948904)
+```
+
+
+
+## ANGLE CLASSIFICATION MODEL INFERENCE
+
+For angle classification model inference, you can execute the following commands:
+
+
+```
+# download text angle class inference model:
+wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar
+tar xf ch_ppocr_mobile_v2.0_cls_infer.tar
+python3 tools/infer/predict_cls.py --image_dir="./doc/imgs_words_en/word_10.png" --cls_model_dir="ch_ppocr_mobile_v2.0_cls_infer"
+```
+![](../imgs_words_en/word_10.png)
+
+After executing the command, the prediction results (classification angle and score) of the above image will be printed on the screen.
+
+```
+ Predicts of ./doc/imgs_words_en/word_10.png:['0', 0.9999995]
+```
+
+
+## TEXT DETECTION ANGLE CLASSIFICATION AND RECOGNITION INFERENCE CONCATENATION
+
+When performing prediction, you need to specify the path of a single image or a folder of images through the parameter `image_dir`, the parameter `det_model_dir` specifies the path to detect the inference model, the parameter `cls_model_dir` specifies the path to angle classification inference model and the parameter `rec_model_dir` specifies the path to identify the inference model. The parameter `use_angle_cls` is used to control whether to enable the angle classification model. The parameter `use_mp` specifies whether to use multi-process to infer `total_process_num` specifies process number when using multi-process. The parameter . The visualized recognition results are saved to the `./inference_results` folder by default.
+
+```shell
+# use direction classifier
+python3 tools/infer/predict_system.py --image_dir="./doc/imgs/00018069.jpg" --det_model_dir="./inference/det_db/" --cls_model_dir="./inference/cls/" --rec_model_dir="./inference/rec_crnn/" --use_angle_cls=true
+
+# not use use direction classifier
+python3 tools/infer/predict_system.py --image_dir="./doc/imgs/00018069.jpg" --det_model_dir="./inference/det_db/" --rec_model_dir="./inference/rec_crnn/"
+
+# use multi-process
+python3 tools/infer/predict_system.py --image_dir="./doc/imgs/00018069.jpg" --det_model_dir="./inference/det_db/" --rec_model_dir="./inference/rec_crnn/" --use_angle_cls=false --use_mp=True --total_process_num=6
+```
+
+
+After executing the command, the recognition result image is as follows:
+
+![](../imgs_results/system_res_00018069.jpg)
diff --git a/doc/doc_en/models_and_config_en.md b/doc/doc_en/models_and_config_en.md
new file mode 100644
index 0000000000000000000000000000000000000000..f80c00715f148974db616f411740580c281659ed
--- /dev/null
+++ b/doc/doc_en/models_and_config_en.md
@@ -0,0 +1,40 @@
+# PP-OCR Model and Configuration
+- [INTRODUCTION ABOUT OCR](#introduction-about-ocr)
+ * [BASIC CONCEPTS OF OCR DETECTION MODEL](#basic-concepts-of-ocr-detection-model)
+ * [Basic concepts of OCR recognition model](#basic-concepts-of-ocr-recognition-model)
+ * [PP-OCR model](#pp-ocr-model)
+ * [And a table of contents](#and-a-table-of-contents)
+ * [On the right](#on-the-right)
+
+
+## 1. INTRODUCTION ABOUT OCR
+
+This section briefly introduces the basic concepts of OCR detection model and recognition model, and introduces PaddleOCR's PP-OCR model.
+
+OCR (Optical Character Recognition, Optical Character Recognition) is currently the general term for text recognition. It is not limited to document or book text recognition, but also includes recognizing text in natural scenes. It can also be called STR (Scene Text Recognition).
+
+OCR text recognition generally includes two parts, text detection and text recognition. The text detection module first uses detection algorithms to detect text lines in the image. And then the recognition algorithm to identify the specific text in the text line.
+
+
+### 1.1 BASIC CONCEPTS OF OCR DETECTION MODEL
+
+Text detection can locate the text area in the image, and then usually mark the word or text line in the form of a bounding box. Traditional text detection algorithms mostly extract features manually, which are characterized by fast speed and good effect in simple scenes, but the effect will be greatly reduced when faced with natural scenes. Currently, deep learning methods are mostly used.
+
+Text detection algorithms based on deep learning can be roughly divided into the following categories:
+1. Method based on target detection. Generally, after the text box is predicted, the final text box is filtered through NMS, which is mostly four-point text box, which is not ideal for curved text scenes. Typical algorithms are methods such as EAST and Text Box.
+2. Method based on text segmentation. The text line is regarded as the segmentation target, and then the external text box is constructed through the segmentation result, which can handle curved text, and the effect is not ideal for the text cross scene problem. Typical algorithms are DB, PSENet and other methods.
+3. Hybrid target detection and segmentation method.
+
+
+### 1.2 Basic concepts of OCR recognition model
+
+The input of the OCR recognition algorithm is generally text lines images which has less background information, and the text information occupies the main part. The recognition algorithm can be divided into two types of algorithms:
+1. CTC-based method. The text prediction module of the recognition algorithm is based on CTC, and the commonly used algorithm combination is CNN+RNN+CTC. There are also some algorithms that try to add transformer modules to the network and so on.
+2. Attention-based method. The text prediction module of the recognition algorithm is based on Attention, and the commonly used algorithm combination is CNN+RNN+Attention.
+
+
+### 1.3 PP-OCR model
+
+PaddleOCR integrates many OCR algorithms, text detection algorithms include DB, EAST, SAST, etc., text recognition algorithms include CRNN, RARE, StarNet, Rosetta, SRN and other algorithms.
+
+Among them, PaddleOCR has released the PP-OCR series model for the general OCR in Chinese and English natural scenes. The PP-OCR model is composed of the DB+CRNN algorithm. It uses massive Chinese data training and model tuning methods to have high text detection and recognition capabilities in Chinese scenes. And PaddleOCR has launched a high-precision and ultra-lightweight PP-OCRv2 model. The detection model is only 3M, and the recognition model is only 8.5M. Using [PaddleSlim](https://github.com/PaddlePaddle/PaddleSlim)'s model quantification method, the detection model can be compressed to 0.8M without reducing the accuracy. The recognition is compressed to 3M, which is more suitable for mobile deployment scenarios.
diff --git a/doc/doc_en/models_list_en.md b/doc/doc_en/models_list_en.md
index 9bee4aef5121b1964a9bdbdeeaad4e81dd9ff6d4..d699678e64963d8949c559e422f48b814ec3b921 100644
--- a/doc/doc_en/models_list_en.md
+++ b/doc/doc_en/models_list_en.md
@@ -1,7 +1,8 @@
-## OCR model list(V2.0, updated on 2021.1.20)
+## OCR model list(V2.1, updated on 2021.9.6)
> **Note**
-> 1. Compared with [models 1.1](https://github.com/PaddlePaddle/PaddleOCR/blob/develop/doc/doc_en/models_list_en.md), which are trained with static graph programming paradigm, models 2.0 are the dynamic graph trained version and achieve close performance.
-> 2. All models in this tutorial are all ppocr-series models, for more introduction of algorithms and models based on public dataset, you can refer to [algorithm overview tutorial](./algorithm_overview_en.md).
+> 1. Compared with the model v2.0, the 2.1 version of the detection model has a improvement in accuracy, and the 2.1 version of the recognition model is optimized in accuracy and CPU speed.
+> 2. Compared with [models 1.1](https://github.com/PaddlePaddle/PaddleOCR/blob/develop/doc/doc_en/models_list_en.md), which are trained with static graph programming paradigm, models 2.0 are the dynamic graph trained version and achieve close performance.
+> 3. All models in this tutorial are all ppocr-series models, for more introduction of algorithms and models based on public dataset, you can refer to [algorithm overview tutorial](./algorithm_overview_en.md).
- [1. Text Detection Model](#Detection)
- [2. Text Recognition Model](#Recognition)
@@ -28,6 +29,8 @@ Relationship of the above models is as follows.
|model name|description|config|model size|download|
| --- | --- | --- | --- | --- |
+|ch_ppocr_mobile_slim_v2.1_det|slim quantization with distillation lightweight model, supporting Chinese, English, multilingual text detection|[ch_det_lite_train_cml_v2.1.yml](../../configs/det/ch_ppocr_v2.1/ch_det_lite_train_cml_v2.1.yml)| 3M |[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_det_slim_quant_infer.tar)|
+|ch_ppocr_mobile_v2.1_det|Original lightweight model, supporting Chinese, English, multilingual text detection|[ch_det_lite_train_cml_v2.1.ym](../../configs/det/ch_ppocr_v2.1/ch_det_lite_train_cml_v2.1.yml)|3M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_det_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_det_distill_train.tar)|
|ch_ppocr_mobile_slim_v2.0_det|Slim pruned lightweight model, supporting Chinese, English, multilingual text detection|[ch_det_mv3_db_v2.0.yml](../../configs/det/ch_ppocr_v2.0/ch_det_mv3_db_v2.0.yml)|2.6M |[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/slim/ch_ppocr_mobile_v2.0_det_prune_infer.tar)|
|ch_ppocr_mobile_v2.0_det|Original lightweight model, supporting Chinese, English, multilingual text detection|[ch_det_mv3_db_v2.0.yml](../../configs/det/ch_ppocr_v2.0/ch_det_mv3_db_v2.0.yml)|3M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_train.tar)|
|ch_ppocr_server_v2.0_det|General model, which is larger than the lightweight model, but achieved better performance|[ch_det_res18_db_v2.0.yml](../../configs/det/ch_ppocr_v2.0/ch_det_res18_db_v2.0.yml)|47M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar)|
@@ -40,6 +43,8 @@ Relationship of the above models is as follows.
|model name|description|config|model size|download|
| --- | --- | --- | --- | --- |
+|ch_ppocr_mobile_slim_v2.1_rec|Slim qunatization with distillation lightweight model, supporting Chinese, English, multilingual text detection|[rec_chinese_lite_train_distillation_v2.1.yml](../../configs/rec/ch_ppocr_v2.1/rec_chinese_lite_train_distillation_v2.1.yml)| 9M |[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_rec_slim_quant_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_rec_slim_quant_train.tar) |
+|ch_ppocr_mobile_v2.1_rec|Original lightweight model, supporting Chinese, English, multilingual text detection|[rec_chinese_lite_train_distillation_v2.1.yml](../../configs/rec/ch_ppocr_v2.1/rec_chinese_lite_train_distillation_v2.1.yml)|8.5M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_rec_train.tar) |
|ch_ppocr_mobile_slim_v2.0_rec|Slim pruned and quantized lightweight model, supporting Chinese, English and number recognition|[rec_chinese_lite_train_v2.0.yml](../../configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml)| 6M | [inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_slim_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_slim_train.tar) |
|ch_ppocr_mobile_v2.0_rec|Original lightweight model, supporting Chinese, English and number recognition|[rec_chinese_lite_train_v2.0.yml](../../configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml)|5.2M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_train.tar) / [pre-trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_pre.tar) |
|ch_ppocr_server_v2.0_rec|General model, supporting Chinese, English and number recognition|[rec_chinese_common_train_v2.0.yml](../../configs/rec/ch_ppocr_v2.0/rec_chinese_common_train_v2.0.yml)|94.8M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_train.tar) / [pre-trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_pre.tar) |
@@ -58,45 +63,6 @@ Relationship of the above models is as follows.
#### Multilingual Recognition Model(Updating...)
-**Note:** The configuration file of the new multi language model is generated by code. You can use the `--help` parameter to check which multi language are supported by current PaddleOCR.
-
-```bash
-# The code needs to run in the specified directory
-cd {your/path/}PaddleOCR/configs/rec/multi_language/
-python3 generate_multi_language_configs.py --help
-```
-
-Take the Italian configuration file as an example:
-##### 1.Generate Italian configuration file to test the model provided
-you can generate the default configuration file through the following command, and use the default language dictionary provided by paddleocr for prediction.
-```bash
-# The code needs to run in the specified directory
-cd {your/path/}PaddleOCR/configs/rec/multi_language/
-# Set the required language configuration file through -l or --language parameter
-# This command will write the default parameter to the configuration file.
-python3 generate_multi_language_configs.py -l it
-```
-##### 2. Generate Italian configuration file to train your own data
-If you want to train your own model, you can prepare the training set file, verification set file, dictionary file and training data path. Here we assume that the Italian training set, verification set, dictionary and training data path are:
-- Training set:{your/path/}PaddleOCR/train_data/train_list.txt
-- Validation set: {your/path/}PaddleOCR/train_data/val_list.txt
-- Use the default dictionary provided by paddleocr:{your/path/}PaddleOCR/ppocr/utils/dict/it_dict.txt
-- Training data path:{your/path/}PaddleOCR/train_data
-```bash
-# The code needs to run in the specified directory
-cd {your/path/}PaddleOCR/configs/rec/multi_language/
-# The -l or --language parameter is required
-# --train modify train_list path
-# --val modify eval_list path
-# --data_dir modify data dir
-# -o modify default parameters
-# --dict Change the dictionary path. The example uses the default dictionary path, so that this parameter can be empty.
-python3 generate_multi_language_configs.py -l it \
---train {path/to/train_list} \
---val {path/to/val_list} \
---data_dir {path/to/data_dir} \
--o Global.use_gpu=False
-```
|model name| dict file | description|config|model size|download|
| --- | --- | --- |--- | --- | --- |
| french_mobile_v2.0_rec | ppocr/utils/dict/french_dict.txt | Lightweight model for French recognition|[rec_french_lite_train.yml](../../configs/rec/multi_language/rec_french_lite_train.yml)|2.65M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/french_mobile_v2.0_rec_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/french_mobile_v2.0_rec_train.tar) |
@@ -120,12 +86,14 @@ For more supported languages, please refer to : [Multi-language model](./multi_l
|model name|description|config|model size|download|
| --- | --- | --- | --- | --- |
-|ch_ppocr_mobile_slim_v2.0_cls|Slim quantized model|[cls_mv3.yml](../../configs/cls/cls_mv3.yml)| 2.1M | [inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_slim_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_slim_train.tar) |
-|ch_ppocr_mobile_v2.0_cls|Original model|[cls_mv3.yml](../../configs/cls/cls_mv3.yml)|1.38M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_train.tar) |
+|ch_ppocr_mobile_slim_v2.0_cls|Slim quantized model for text angle classification|[cls_mv3.yml](../../configs/cls/cls_mv3.yml)| 2.1M | [inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_slim_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_slim_train.tar) |
+|ch_ppocr_mobile_v2.0_cls|Original model for text angle classification|[cls_mv3.yml](../../configs/cls/cls_mv3.yml)|1.38M|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar) / [trained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_train.tar) |
### 4. Paddle-Lite Model
|Version|Introduction|Model size|Detection model|Text Direction model|Recognition model|Paddle-Lite branch|
|---|---|---|---|---|---|---|
-|V2.0|extra-lightweight chinese OCR optimized model|7.8M|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_det_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_cls_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_rec_opt.nb)|v2.9|
-|V2.0(slim)|extra-lightweight chinese OCR optimized model|3.3M|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_det_slim_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_cls_slim_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_rec_slim_opt.nb)|v2.9|
+|V2.1|ppocr_v2.1 extra-lightweight chinese OCR optimized model|11M|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_det_infer_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_cls_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_rec_infer_opt.nb)|v2.9|
+|V2.1(slim)|extra-lightweight chinese OCR optimized model|4.9M|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_det_slim_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_cls_slim_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_rec_slim_opt.nb)|v2.9|
+|V2.0|ppocr_v2.0 extra-lightweight chinese OCR optimized model|7.8M|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_det_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_cls_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_rec_opt.nb)|v2.9|
+|V2.0(slim)|ppovr_v2.0 extra-lightweight chinese OCR optimized model|3.3M|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_det_slim_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_cls_slim_opt.nb)|[download link](https://paddleocr.bj.bcebos.com/dygraph_v2.0/lite/ch_ppocr_mobile_v2.0_rec_slim_opt.nb)|v2.9|
diff --git a/doc/doc_en/multi_languages_en.md b/doc/doc_en/multi_languages_en.md
index 43650c6ddfdd8c27ab44d0495111a767aeac9ca8..545be5524f2c52c9799d3b013f1aac8baf1a379f 100644
--- a/doc/doc_en/multi_languages_en.md
+++ b/doc/doc_en/multi_languages_en.md
@@ -198,13 +198,13 @@ If necessary, you can read related documents:
| Language | Abbreviation | | Language | Abbreviation |
| --- | --- | --- | --- | --- |
-|chinese and english|ch| |Arabic|ar|
-|english|en| |Hindi|hi|
-|french|fr| |Uyghur|ug|
-|german|german| |Persian|fa|
-|japan|japan| |Urdu|ur|
-|korean|korean| | Serbian(latin) |rs_latin|
-|chinese traditional |ch_tra| |Occitan |oc|
+|Chinese & English|ch| |Arabic|ar|
+|English|en| |Hindi|hi|
+|French|fr| |Uyghur|ug|
+|German|german| |Persian|fa|
+|Japan|japan| |Urdu|ur|
+|Korean|korean| | Serbian(latin) |rs_latin|
+|Chinese Traditional |chinese_cht| |Occitan |oc|
| Italian |it| |Marathi|mr|
|Spanish |es| |Nepali|ne|
| Portuguese|pt| |Serbian(cyrillic)|rs_cyrillic|
diff --git a/doc/doc_en/paddleOCR_overview_en.md b/doc/doc_en/paddleOCR_overview_en.md
new file mode 100644
index 0000000000000000000000000000000000000000..403cd99415e08de198270fb5bfe1a43f297c5156
--- /dev/null
+++ b/doc/doc_en/paddleOCR_overview_en.md
@@ -0,0 +1,39 @@
+# PaddleOCR Overview and Project Clone
+
+## 1. PaddleOCR Overview
+
+PaddleOCR contains rich text detection, text recognition and end-to-end algorithms. Combining actual testing and industrial experience, PaddleOCR chooses DB and CRNN as the basic detection and recognition models, and proposes a series of models, named PP-OCR, for industrial applications after a series of optimization strategies. The PP-OCR model is aimed at general scenarios and forms a model library according to different languages. Based on the capabilities of PP-OCR, PaddleOCR releases the PP-Structure tool library for document scene tasks, including two major tasks: layout analysis and table recognition. In order to get through the entire process of industrial landing, PaddleOCR provides large-scale data production tools and a variety of prediction deployment tools to help developers quickly turn ideas into reality.
+
+
+
+
+
+
+
+## 2. Project Clone
+
+### **2.1 Clone PaddleOCR repo**
+
+```
+# Recommend
+git clone https://github.com/PaddlePaddle/PaddleOCR
+
+# If you cannot pull successfully due to network problems, you can also choose to use the code hosting on the cloud:
+
+git clone https://gitee.com/paddlepaddle/PaddleOCR
+
+# Note: The cloud-hosting code may not be able to synchronize the update with this GitHub project in real time. There might be a delay of 3-5 days. Please give priority to the recommended method.
+```
+
+### **2.2 Install third-party libraries**
+
+```
+cd PaddleOCR
+pip3 install -r requirements.txt
+```
+
+If you getting this error `OSError: [WinError 126] The specified module could not be found` when you install shapely on windows.
+
+Please try to download Shapely whl file using [http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely](http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely).
+
+Reference: [Solve shapely installation on windows](
\ No newline at end of file
diff --git a/doc/doc_en/quickstart_en.md b/doc/doc_en/quickstart_en.md
index a5c0881de30bfd4b76d30c7840b6585b5d7e2af9..19d6f327a64134be4ef5763ded7ce3fd5d8590ef 100644
--- a/doc/doc_en/quickstart_en.md
+++ b/doc/doc_en/quickstart_en.md
@@ -1,103 +1,252 @@
-# Quick start of Chinese OCR model
+# PaddleOCR Quick Start
-## 1. Prepare for the environment
+[PaddleOCR Quick Start](#paddleocr-quick-start)
-Please refer to [quick installation](./installation_en.md) to configure the PaddleOCR operating environment.
++ [1. Install PaddleOCR Whl Package](#1-install-paddleocr-whl-package)
+* [2. Easy-to-Use](#2-easy-to-use)
+ + [2.1 Use by command line](#21-use-by-command-line)
+ - [2.1.1 English and Chinese Model](#211-english-and-chinese-model)
+ - [2.1.2 Multi-language Model](#212-multi-language-model)
+ - [2.1.3 Layout Analysis](#213-layoutAnalysis)
+ + [2.2 Use by Code](#22-use-by-code)
+ - [2.2.1 Chinese & English Model and Multilingual Model](#221-chinese---english-model-and-multilingual-model)
+ - [2.2.2 Layout Analysis](#222-layoutAnalysis)
-* Note: Support the use of PaddleOCR through whl package installation,pelease refer [PaddleOCR Package](./whl_en.md).
-## 2.inference models
-The detection and recognition models on the mobile and server sides are as follows. For more models (including multiple languages), please refer to [PP-OCR v2.0 series model list](../doc_ch/models_list.md)
+
-| Model introduction | Model name | Recommended scene | Detection model | Direction Classifier | Recognition model |
-| ------------ | --------------- | ----------------|---- | ---------- | -------- |
-| Ultra-lightweight Chinese OCR model (8.1M) | ch_ppocr_mobile_v2.0_xx |Mobile-side/Server-side|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar) / [pretrained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_train.tar)|[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar) / [pretrained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_train.tar) |[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar) / [pretrained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_pre.tar) |
-| Universal Chinese OCR model (143M) | ch_ppocr_server_v2.0_xx |Server-side |[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_infer.tar) / [pretrained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar) |[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar) / [pretrained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_train.tar) |[inference model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar) / [pretrained model](https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_pre.tar) |
+## 1. Install PaddleOCR Whl Package
+```bash
+pip install "paddleocr>=2.0.1" # Recommend to use version 2.0.1+
+```
-* If `wget` is not installed in the windows environment, you can copy the link to the browser to download when downloading the model, then uncompress it and place it in the corresponding directory.
+- **For windows users:** If you getting this error `OSError: [WinError 126] The specified module could not be found` when you install shapely on windows. Please try to download Shapely whl file [here](http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely).
-Copy the download address of the `inference model` for detection and recognition in the table above, and uncompress them.
+ Reference: [Solve shapely installation on windows](https://stackoverflow.com/questions/44398265/install-shapely-oserror-winerror-126-the-specified-module-could-not-be-found)
-```
-mkdir inference && cd inference
-# Download the detection model and unzip
-wget {url/of/detection/inference_model} && tar xf {name/of/detection/inference_model/package}
-# Download the recognition model and unzip
-wget {url/of/recognition/inference_model} && tar xf {name/of/recognition/inference_model/package}
-# Download the direction classifier model and unzip
-wget {url/of/classification/inference_model} && tar xf {name/of/classification/inference_model/package}
-cd ..
-```
+- **For layout analysis users**, run the following command to install **Layout-Parser**
-Take the ultra-lightweight model as an example:
+ ```bash
+ pip3 install -U https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl
+ ```
+
+
+## 2. Easy-to-Use
+
+
+
+### 2.1 Use by command line
+
+PaddleOCR provides a series of test images, click [here](https://paddleocr.bj.bcebos.com/dygraph_v2.1/ppocr_img.zip) to download, and then switch to the corresponding directory in the terminal
+
+```bash
+cd /path/to/ppocr_img
```
-mkdir inference && cd inference
-# Download the detection model of the ultra-lightweight Chinese OCR model and uncompress it
-wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_det_infer.tar
-# Download the recognition model of the ultra-lightweight Chinese OCR model and uncompress it
-wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar
-# Download the angle classifier model of the ultra-lightweight Chinese OCR model and uncompress it
-wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar && tar xf ch_ppocr_mobile_v2.0_cls_infer.tar
-cd ..
-```
-After decompression, the file structure should be as follows:
+If you do not use the provided test image, you can replace the following `--image_dir` parameter with the corresponding test image path
+
+
+
+#### 2.1.1 Chinese and English Model
+
+* Detection, direction classification and recognition: set the direction classifier parameter`--use_angle_cls true` to recognize vertical text.
+
+ ```bash
+ paddleocr --image_dir ./imgs_en/img_12.jpg --use_angle_cls true --lang en
+ ```
+
+ Output will be a list, each item contains bounding box, text and recognition confidence
+
+ ```bash
+ [[[442.0, 173.0], [1169.0, 173.0], [1169.0, 225.0], [442.0, 225.0]], ['ACKNOWLEDGEMENTS', 0.99283075]]
+ [[[393.0, 340.0], [1207.0, 342.0], [1207.0, 389.0], [393.0, 387.0]], ['We would like to thank all the designers and', 0.9357758]]
+ [[[399.0, 398.0], [1204.0, 398.0], [1204.0, 433.0], [399.0, 433.0]], ['contributors whohave been involved in the', 0.9592447]]
+ ......
+ ```
+
+* Only detection: set `--rec` to `false`
+
+ ```bash
+ paddleocr --image_dir ./imgs_en/img_12.jpg --rec false
+ ```
+
+ Output will be a list, each item only contains bounding box
+ ```bash
+ [[756.0, 812.0], [805.0, 812.0], [805.0, 830.0], [756.0, 830.0]]
+ [[820.0, 803.0], [1085.0, 801.0], [1085.0, 836.0], [820.0, 838.0]]
+ [[393.0, 801.0], [715.0, 805.0], [715.0, 839.0], [393.0, 836.0]]
+ ......
+ ```
+
+* Only recognition: set `--det` to `false`
+
+ ```bash
+ paddleocr --image_dir ./imgs_words_en/word_10.png --det false --lang en
+ ```
+
+ Output will be a list, each item contains text and recognition confidence
+
+ ```bash
+ ['PAIN', 0.990372]
+ ```
+
+More whl package usage can be found in [whl package](./whl_en.md)
+
+
+#### 2.1.2 Multi-language Model
+
+Paddleocr currently supports 80 languages, which can be switched by modifying the `--lang` parameter.
+
+``` bash
+paddleocr --image_dir ./doc/imgs_en/254.jpg --lang=en
```
-├── ch_ppocr_mobile_v2.0_cls_infer
-│ ├── inference.pdiparams
-│ ├── inference.pdiparams.info
-│ └── inference.pdmodel
-├── ch_ppocr_mobile_v2.0_det_infer
-│ ├── inference.pdiparams
-│ ├── inference.pdiparams.info
-│ └── inference.pdmodel
-├── ch_ppocr_mobile_v2.0_rec_infer
- ├── inference.pdiparams
- ├── inference.pdiparams.info
- └── inference.pdmodel
+
+
+
+
+
+The result is a list, each item contains a text box, text and recognition confidence
+
+```text
+[('PHO CAPITAL', 0.95723116), [[66.0, 50.0], [327.0, 44.0], [327.0, 76.0], [67.0, 82.0]]]
+[('107 State Street', 0.96311164), [[72.0, 90.0], [451.0, 84.0], [452.0, 116.0], [73.0, 121.0]]]
+[('Montpelier Vermont', 0.97389287), [[69.0, 132.0], [501.0, 126.0], [501.0, 158.0], [70.0, 164.0]]]
+[('8022256183', 0.99810505), [[71.0, 175.0], [363.0, 170.0], [364.0, 202.0], [72.0, 207.0]]]
+[('REG 07-24-201706:59 PM', 0.93537045), [[73.0, 299.0], [653.0, 281.0], [654.0, 318.0], [74.0, 336.0]]]
+[('045555', 0.99346405), [[509.0, 331.0], [651.0, 325.0], [652.0, 356.0], [511.0, 362.0]]]
+[('CT1', 0.9988654), [[535.0, 367.0], [654.0, 367.0], [654.0, 406.0], [535.0, 406.0]]]
+......
```
-## 3. Single image or image set prediction
+Commonly used multilingual abbreviations include
+
+| Language | Abbreviation | | Language | Abbreviation | | Language | Abbreviation |
+| ------------------- | ------------ | ---- | -------- | ------------ | ---- | -------- | ------------ |
+| Chinese & English | ch | | French | fr | | Japanese | japan |
+| English | en | | German | german | | Korean | korean |
+| Chinese Traditional | chinese_cht | | Italian | it | | Russian | ru |
-* The following code implements text detection、angle class and recognition process. When performing prediction, you need to specify the path of a single image or image set through the parameter `image_dir`, the parameter `det_model_dir` specifies the path to detect the inference model, the parameter `rec_model_dir` specifies the path to identify the inference model, the parameter `use_angle_cls` specifies whether to use the direction classifier, the parameter `cls_model_dir` specifies the path to identify the direction classifier model, the parameter `use_space_char` specifies whether to predict the space char. The visual results are saved to the `./inference_results` folder by default.
+A list of all languages and their corresponding abbreviations can be found in [Multi-Language Model Tutorial](./multi_languages_en.md)
+
+#### 2.1.3 Layout Analysis
+Layout analysis refers to the division of 5 types of areas of the document, including text, title, list, picture and table. For the first three types of regions, directly use the OCR model to complete the text detection and recognition of the corresponding regions, and save the results in txt. For the table area, after the table structuring process, the table picture is converted into an Excel file of the same table style. The picture area will be individually cropped into an image.
+
+To use the layout analysis function of PaddleOCR, you need to specify `--type=structure`
```bash
+paddleocr --image_dir=../doc/table/1.png --type=structure
+```
-# Predict a single image specified by image_dir
-python3 tools/infer/predict_system.py --image_dir="./doc/imgs/11.jpg" --det_model_dir="./inference/ch_ppocr_mobile_v2.0_det_infer/" --rec_model_dir="./inference/ch_ppocr_mobile_v2.0_rec_infer/" --cls_model_dir="./inference/ch_ppocr_mobile_v2.0_cls_infer/" --use_angle_cls=True --use_space_char=True
+- **Results Format**
+
+ The returned results of PP-Structure is a list composed of a dict, an example is as follows
+
+ ```shell
+ [
+ { 'type': 'Text',
+ 'bbox': [34, 432, 345, 462],
+ 'res': ([[36.0, 437.0, 341.0, 437.0, 341.0, 446.0, 36.0, 447.0], [41.0, 454.0, 125.0, 453.0, 125.0, 459.0, 41.0, 460.0]],
+ [('Tigure-6. The performance of CNN and IPT models using difforen', 0.90060663), ('Tent ', 0.465441)])
+ }
+ ]
+ ```
+
+ The description of each field in dict is as follows
+
+ | Parameter | Description |
+ | --------- | ------------------------------------------------------------ |
+ | type | Type of image area |
+ | bbox | The coordinates of the image area in the original image, respectively [left upper x, left upper y, right bottom x, right bottom y] |
+ | res | OCR or table recognition result of image area。
Table: HTML string of the table;
OCR: A tuple containing the detection coordinates and recognition results of each single line of text |
+
+- **Parameter Description:**
+
+ | Parameter | Description | Default value |
+ | --------------- | ------------------------------------------------------------ | -------------------------------------------- |
+ | output | The path where excel and recognition results are saved | ./output/table |
+ | table_max_len | The long side of the image is resized in table structure model | 488 |
+ | table_model_dir | inference model path of table structure model | None |
+ | table_char_type | dict path of table structure model | ../ppocr/utils/dict/table_structure_dict.txt |
+
+
+
+### 2.2 Use by Code
+
+
+#### 2.2.1 Chinese & English Model and Multilingual Model
+
+* detection, angle classification and recognition:
+
+```python
+from paddleocr import PaddleOCR,draw_ocr
+# Paddleocr supports Chinese, English, French, German, Korean and Japanese.
+# You can set the parameter `lang` as `ch`, `en`, `fr`, `german`, `korean`, `japan`
+# to switch the language model in order.
+ocr = PaddleOCR(use_angle_cls=True, lang='en') # need to run only once to download and load model into memory
+img_path = './imgs_en/img_12.jpg'
+result = ocr.ocr(img_path, cls=True)
+for line in result:
+ print(line)
+
+
+# draw result
+from PIL import Image
+image = Image.open(img_path).convert('RGB')
+boxes = [line[0] for line in result]
+txts = [line[1][0] for line in result]
+scores = [line[1][1] for line in result]
+im_show = draw_ocr(image, boxes, txts, scores, font_path='./fonts/simfang.ttf')
+im_show = Image.fromarray(im_show)
+im_show.save('result.jpg')
+```
-# Predict imageset specified by image_dir
-python3 tools/infer/predict_system.py --image_dir="./doc/imgs/" --det_model_dir="./inference/ch_ppocr_mobile_v2.0_det_infer/" --rec_model_dir="./inference/ch_ppocr_mobile_v2.0_rec_infer/" --cls_model_dir="./inference/ch_ppocr_mobile_v2.0_cls_infer/" --use_angle_cls=True --use_space_char=True
+Output will be a list, each item contains bounding box, text and recognition confidence
-# If you want to use the CPU for prediction, you need to set the use_gpu parameter to False
-python3 tools/infer/predict_system.py --image_dir="./doc/imgs/11.jpg" --det_model_dir="./inference/ch_ppocr_mobile_v2.0_det_infer/" --rec_model_dir="./inference/ch_ppocr_mobile_v2.0_rec_infer/" --cls_model_dir="./inference/ch_ppocr_mobile_v2.0_cls_infer/" --use_angle_cls=True --use_space_char=True --use_gpu=False
+```bash
+[[[442.0, 173.0], [1169.0, 173.0], [1169.0, 225.0], [442.0, 225.0]], ['ACKNOWLEDGEMENTS', 0.99283075]]
+[[[393.0, 340.0], [1207.0, 342.0], [1207.0, 389.0], [393.0, 387.0]], ['We would like to thank all the designers and', 0.9357758]]
+[[[399.0, 398.0], [1204.0, 398.0], [1204.0, 433.0], [399.0, 433.0]], ['contributors whohave been involved in the', 0.9592447]]
+......
```
-- Universal Chinese OCR model
+Visualization of results
-Please follow the above steps to download the corresponding models and update the relevant parameters, The example is as follows.
+
+
+
+
-```
-# Predict a single image specified by image_dir
-python3 tools/infer/predict_system.py --image_dir="./doc/imgs/11.jpg" --det_model_dir="./inference/ch_ppocr_server_v2.0_det_infer/" --rec_model_dir="./inference/ch_ppocr_server_v2.0_rec_infer/" --cls_model_dir="./inference/ch_ppocr_mobile_v2.0_cls_infer/" --use_angle_cls=True --use_space_char=True
-```
+#### 2.2.2 Layout Analysis
+
+```python
+import os
+import cv2
+from paddleocr import PPStructure,draw_structure_result,save_structure_res
-* Note
- - If you want to use the recognition model which does not support space char recognition, please update the source code to the latest version and add parameters `--use_space_char=False`.
- - If you do not want to use direction classifier, please update the source code to the latest version and add parameters `--use_angle_cls=False`.
+table_engine = PPStructure(show_log=True)
+save_folder = './output/table'
+img_path = './table/1.png'
+img = cv2.imread(img_path)
+result = table_engine(img)
+save_structure_res(result, save_folder,os.path.basename(img_path).split('.')[0])
-For more text detection and recognition tandem reasoning, please refer to the document tutorial
-: [Inference with Python inference engine](./inference_en.md)。
+for line in result:
+ line.pop('img')
+ print(line)
-In addition, the tutorial also provides other deployment methods for the Chinese OCR model:
-- [Server-side C++ inference](../../deploy/cpp_infer/readme_en.md)
-- [Service deployment](../../deploy/hubserving)
-- [End-to-end deployment](https://github.com/PaddlePaddle/PaddleOCR/tree/develop/deploy/lite)
+from PIL import Image
+
+font_path = './fonts/simfang.ttf'
+image = Image.open(img_path).convert('RGB')
+im_show = draw_structure_result(image, result,font_path=font_path)
+im_show = Image.fromarray(im_show)
+im_show.save('result.jpg')
+```
diff --git a/doc/doc_en/recognition_en.md b/doc/doc_en/recognition_en.md
index 6d2e0947e44ff5f2af8c3b3c7a0715df7a0ea969..fdc5103a4258e1d921c36eb99116fdc229cce608 100644
--- a/doc/doc_en/recognition_en.md
+++ b/doc/doc_en/recognition_en.md
@@ -1,4 +1,4 @@
-## TEXT RECOGNITION
+# TEXT RECOGNITION
- [1 DATA PREPARATION](#DATA_PREPARATION)
- [1.1 Costom Dataset](#Costom_Dataset)
@@ -8,8 +8,8 @@
- [2 TRAINING](#TRAINING)
- [2.1 Data Augmentation](#Data_Augmentation)
- - [2.2 Training](#Training)
- - [2.3 Multi-language](#Multi_language)
+ - [2.2 General Training](#Training)
+ - [2.3 Multi-language Training](#Multi_language)
- [3 EVALUATION](#EVALUATION)
@@ -17,12 +17,12 @@
- [4.1 Training engine prediction](#Training_engine_prediction)
-### DATA PREPARATION
+## 1 DATA PREPARATION
PaddleOCR supports two data formats:
-- `LMDB` is used to train data sets stored in lmdb format;
-- `general data` is used to train data sets stored in text files:
+- `LMDB` is used to train data sets stored in lmdb format(LMDBDataSet);
+- `general data` is used to train data sets stored in text files(SimpleDataSet):
Please organize the dataset as follows:
@@ -36,7 +36,7 @@ mklink /d /train_data/dataset
```
-#### 1.1 Costom dataset
+### 1.1 Costom dataset
If you want to use your own data for training, please refer to the following to organize your data.
@@ -84,11 +84,12 @@ Similar to the training set, the test set also needs to be provided a folder con
```
-#### 1.2 Dataset download
+### 1.2 Dataset download
-If you do not have a dataset locally, you can download it on the official website [icdar2015](http://rrc.cvc.uab.es/?ch=4&com=downloads). Also refer to [DTRB](https://github.com/clovaai/deep-text-recognition-benchmark#download-lmdb-dataset-for-traininig-and-evaluation-from-here) ,download the lmdb format dataset required for benchmark
+- ICDAR2015
-If you want to reproduce the paper indicators of SRN, you need to download offline [augmented data](https://pan.baidu.com/s/1-HSZ-ZVdqBF2HaBZ5pRAKA), extraction code: y3ry. The augmented data is obtained by rotation and perturbation of mjsynth and synthtext. Please unzip the data to {your_path}/PaddleOCR/train_data/data_lmdb_Release/training/path.
+If you do not have a dataset locally, you can download it on the official website [icdar2015](http://rrc.cvc.uab.es/?ch=4&com=downloads).
+Also refer to [DTRB](https://github.com/clovaai/deep-text-recognition-benchmark#download-lmdb-dataset-for-traininig-and-evaluation-from-here) ,download the lmdb format dataset required for benchmark
If you want to reproduce the paper SAR, you need to download extra dataset [SynthAdd](https://pan.baidu.com/share/init?surl=uV0LtoNmcxbO-0YA7Ch4dg), extraction code: 627x. Besides, icdar2013, icdar2015, cocotext, IIIT5k datasets are also used to train. For specific details, please refer to the paper SAR.
@@ -101,8 +102,28 @@ wget -P ./train_data/ic15_data https://paddleocr.bj.bcebos.com/dataset/rec_gt_t
wget -P ./train_data/ic15_data https://paddleocr.bj.bcebos.com/dataset/rec_gt_test.txt
```
+PaddleOCR also provides a data format conversion script, which can convert ICDAR official website label to a data format
+supported by PaddleOCR. The data conversion tool is in `ppocr/utils/gen_label.py`, here is the training set as an example:
+
+```
+# convert the official gt to rec_gt_label.txt
+python gen_label.py --mode="rec" --input_path="{path/of/origin/label}" --output_label="rec_gt_label.txt"
+```
+
+The data format is as follows, (a) is the original picture, (b) is the Ground Truth text file corresponding to each picture:
+
+![](../datasets/icdar_rec.png)
+
+
+- Multilingual dataset
+
+The multi-language model training method is the same as the Chinese model. The training data set is 100w synthetic data. A small amount of fonts and test data can be downloaded using the following two methods.
+* [Baidu Netdisk](https://pan.baidu.com/s/1bS_u207Rm7YbY33wOECKDA) ,Extraction code:frgi.
+* [Google drive](https://drive.google.com/file/d/18cSWX7wXSy4G0tbKJ0d9PuIaiwRLHpjA/view)
+
+
-#### 1.3 Dictionary
+### 1.3 Dictionary
Finally, a dictionary ({word_dict_name}.txt) needs to be provided so that when the model is trained, all the characters that appear can be mapped to the dictionary index.
@@ -147,14 +168,26 @@ To customize the dict file, please modify the `character_dict_path` field in `co
If you need to customize dic file, please add character_dict_path field in configs/rec/rec_icdar15_train.yml to point to your dictionary path. And set character_type to ch.
-#### 1.4 Add space category
+### 1.4 Add space category
If you want to support the recognition of the `space` category, please set the `use_space_char` field in the yml file to `True`.
**Note: use_space_char only takes effect when character_type=ch**
-### 2 TRAINING
+## 2 TRAINING
+
+
+### 2.1 Data Augmentation
+
+PaddleOCR provides a variety of data augmentation methods. All the augmentation methods are enabled by default.
+
+The default perturbation methods are: cvtColor, blur, jitter, Gasuss noise, random crop, perspective, color reverse, TIA augmentation.
+
+Each disturbance method is selected with a 40% probability during the training process. For specific code implementation, please refer to: [rec_img_aug.py](../../ppocr/data/imaug/rec_img_aug.py)
+
+
+### 2.2 General Training
PaddleOCR provides training scripts, evaluation scripts, and prediction scripts. In this section, the CRNN recognition model will be used as an example:
@@ -172,21 +205,15 @@ tar -xf rec_mv3_none_bilstm_ctc_v2.0_train.tar && rm -rf rec_mv3_none_bilstm_ctc
Start training:
```
-# GPU training Support single card and multi-card training, specify the card number through --gpus
+# GPU training Support single card and multi-card training
# Training icdar15 English data and The training log will be automatically saved as train.log under "{save_model_dir}"
+
+#specify the single card training(Long training time, not recommended)
+python3 tools/train.py -c configs/rec/rec_icdar15_train.yml
+#specify the card number through --gpus
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/rec/rec_icdar15_train.yml
```
-
-#### 2.1 Data Augmentation
-
-PaddleOCR provides a variety of data augmentation methods. All the augmentation methods are enabled by default.
-The default perturbation methods are: cvtColor, blur, jitter, Gasuss noise, random crop, perspective, color reverse, TIA augmentation.
-
-Each disturbance method is selected with a 40% probability during the training process. For specific code implementation, please refer to: [rec_img_aug.py](../../ppocr/data/imaug/rec_img_aug.py)
-
-
-#### 2.2 Training
PaddleOCR supports alternating training and evaluation. You can modify `eval_batch_step` in `configs/rec/rec_icdar15_train.yml` to set the evaluation frequency. By default, it is evaluated every 500 iter and the best acc model is saved under `output/rec_CRNN/best_accuracy` during the evaluation process.
@@ -281,87 +308,7 @@ Eval:
**Note that the configuration file for prediction/evaluation must be consistent with the training.**
-#### 2.3 Multi-language
-
-PaddleOCR currently supports 80 (except Chinese) language recognition. A multi-language configuration file template is
-provided under the path `configs/rec/multi_languages`: [rec_multi_language_lite_train.yml](../../configs/rec/multi_language/rec_multi_language_lite_train.yml)。
-
-There are two ways to create the required configuration file::
-
-1. Automatically generated by script
-
-[generate_multi_language_configs.py](../../configs/rec/multi_language/generate_multi_language_configs.py) Can help you generate configuration files for multi-language models
-
-- Take Italian as an example, if your data is prepared in the following format:
- ```
- |-train_data
- |- it_train.txt # train_set label
- |- it_val.txt # val_set label
- |- data
- |- word_001.jpg
- |- word_002.jpg
- |- word_003.jpg
- | ...
- ```
-
- You can use the default parameters to generate a configuration file:
-
- ```bash
- # The code needs to be run in the specified directory
- cd PaddleOCR/configs/rec/multi_language/
- # Set the configuration file of the language to be generated through the -l or --language parameter.
- # This command will write the default parameters into the configuration file
- python3 generate_multi_language_configs.py -l it
- ```
-
-- If your data is placed in another location, or you want to use your own dictionary, you can generate the configuration file by specifying the relevant parameters:
-
- ```bash
- # -l or --language field is required
- # --train to modify the training set
- # --val to modify the validation set
- # --data_dir to modify the data set directory
- # --dict to modify the dict path
- # -o to modify the corresponding default parameters
- cd PaddleOCR/configs/rec/multi_language/
- python3 generate_multi_language_configs.py -l it \ # language
- --train {path/of/train_label.txt} \ # path of train_label
- --val {path/of/val_label.txt} \ # path of val_label
- --data_dir {train_data/path} \ # root directory of training data
- --dict {path/of/dict} \ # path of dict
- -o Global.use_gpu=False # whether to use gpu
- ...
-
- ```
-Italian is made up of Latin letters, so after executing the command, you will get the rec_latin_lite_train.yml.
-
-2. Manually modify the configuration file
-
- You can also manually modify the following fields in the template:
-
- ```
- Global:
- use_gpu: True
- epoch_num: 500
- ...
- character_type: it # language
- character_dict_path: {path/of/dict} # path of dict
-
- Train:
- dataset:
- name: SimpleDataSet
- data_dir: train_data/ # root directory of training data
- label_file_list: ["./train_data/train_list.txt"] # train label path
- ...
-
- Eval:
- dataset:
- name: SimpleDataSet
- data_dir: train_data/ # root directory of val data
- label_file_list: ["./train_data/val_list.txt"] # val label path
- ...
-
- ```
+### 2.3 Multi-language Training
Currently, the multi-language algorithms supported by PaddleOCR are:
@@ -380,9 +327,6 @@ Currently, the multi-language algorithms supported by PaddleOCR are:
For more supported languages, please refer to : [Multi-language model](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_en/multi_languages_en.md#4-support-languages-and-abbreviations)
-The multi-language model training method is the same as the Chinese model. The training data set is 100w synthetic data. A small amount of fonts and test data can be downloaded using the following two methods.
-* [Baidu Netdisk](https://pan.baidu.com/s/1bS_u207Rm7YbY33wOECKDA),Extraction code:frgi.
-* [Google drive](https://drive.google.com/file/d/18cSWX7wXSy4G0tbKJ0d9PuIaiwRLHpjA/view)
If you want to finetune on the basis of the existing model effect, please refer to the following instructions to modify the configuration file:
@@ -421,7 +365,7 @@ Eval:
```
-### 3 EVALUATION
+## 3 EVALUATION
The evaluation dataset can be set by modifying the `Eval.dataset.label_file_list` field in the `configs/rec/rec_icdar15_train.yml` file.
@@ -431,20 +375,39 @@ python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/rec
```
-### 4 PREDICTION
+## 4 PREDICTION
-
-#### 4.1 Training engine prediction
Using the model trained by paddleocr, you can quickly get prediction through the following script.
-The default prediction picture is stored in `infer_img`, and the weight is specified via `-o Global.checkpoints`:
+The default prediction picture is stored in `infer_img`, and the trained weight is specified via `-o Global.checkpoints`:
+
+
+According to the `save_model_dir` and `save_epoch_step` fields set in the configuration file, the following parameters will be saved:
+
+```
+output/rec/
+├── best_accuracy.pdopt
+├── best_accuracy.pdparams
+├── best_accuracy.states
+├── config.yml
+├── iter_epoch_3.pdopt
+├── iter_epoch_3.pdparams
+├── iter_epoch_3.states
+├── latest.pdopt
+├── latest.pdparams
+├── latest.states
+└── train.log
+```
+
+Among them, best_accuracy.* is the best model on the evaluation set; iter_epoch_x.* is the model saved at intervals of `save_epoch_step`; latest.* is the model of the last epoch.
```
# Predict English results
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml -o Global.pretrained_model={path/to/weights}/best_accuracy Global.load_static_weights=false Global.infer_img=doc/imgs_words/en/word_1.jpg
```
+
Input image:
![](../imgs_words/en/word_1.png)
diff --git a/doc/doc_en/training_en.md b/doc/doc_en/training_en.md
new file mode 100644
index 0000000000000000000000000000000000000000..eaae2d1e31a2849ea4c0d9315d145888aaeca4cf
--- /dev/null
+++ b/doc/doc_en/training_en.md
@@ -0,0 +1,141 @@
+# MODEL TRAINING
+
+- [1. Basic concepts](#1-basic-concepts)
+ * [1.1 Learning rate](#11-learning-rate)
+ * [1.2 Regularization](#12-regularization)
+ * [1.3 Evaluation indicators](#13-evaluation-indicators-)
+- [2. Data and vertical scenes](#2-data-and-vertical-scenes)
+ * [2.1 Training data](#21-training-data)
+ * [2.2 Vertical scene](#22-vertical-scene)
+ * [2.3 Build your own data set](#23-build-your-own-data-set)
+* [3. FAQ](#3-faq)
+
+
+This article will introduce the basic concepts that need to be mastered during model training and the tuning methods during training.
+
+At the same time, it will briefly introduce the components of the PaddleOCR model training data and how to prepare the data finetune model in the vertical scene.
+
+
+# 1. Basic concepts
+
+OCR (Optical Character Recognition) refers to the process of analyzing and recognizing images to obtain text and layout information. It is a typical computer vision task.
+It usually consists of two subtasks: text detection and text recognition.
+
+The following parameters need to be paid attention to when tuning the model:
+
+
+## 1.1 Learning rate
+
+The learning rate is one of the important hyperparameters for training neural networks. It represents the step length of the gradient moving to the optimal solution of the loss function in each iteration.
+A variety of learning rate update strategies are provided in PaddleOCR, which can be modified through configuration files, for example:
+
+```
+Optimizer:
+ ...
+ lr:
+ name: Piecewise
+ decay_epochs : [700, 800]
+ values : [0.001, 0.0001]
+ warmup_epoch: 5
+```
+
+Piecewise stands for piecewise constant attenuation. Different learning rates are specified in different learning stages,
+and the learning rate is the same in each stage.
+
+warmup_epoch means that in the first 5 epochs, the learning rate will gradually increase from 0 to base_lr. For all strategies, please refer to the code [learning_rate.py](../../ppocr/optimizer/learning_rate.py).
+
+
+## 1.2 Regularization
+
+Regularization can effectively avoid algorithm overfitting. PaddleOCR provides L1 and L2 regularization methods.
+L1 and L2 regularization are the most commonly used regularization methods.
+L1 regularization adds a regularization term to the objective function to reduce the sum of absolute values of the parameters;
+while in L2 regularization, the purpose of adding a regularization term is to reduce the sum of squared parameters.
+The configuration method is as follows:
+
+```
+Optimizer:
+ ...
+ regularizer:
+ name: L2
+ factor: 2.0e-05
+```
+
+## 1.3 Evaluation indicators
+
+(1) Detection stage: First, evaluate according to the IOU of the detection frame and the labeled frame. If the IOU is greater than a certain threshold, it is judged that the detection is accurate. Here, the detection frame and the label frame are different from the general general target detection frame, and they are represented by polygons. Detection accuracy: the percentage of the correct detection frame number in all detection frames is mainly used to judge the detection index. Detection recall rate: the percentage of correct detection frames in all marked frames, which is mainly an indicator of missed detection.
+
+(2) Recognition stage: Character recognition accuracy, that is, the ratio of correctly recognized text lines to the number of marked text lines. Only the entire line of text recognition pairs can be regarded as correct recognition.
+
+(3) End-to-end statistics: End-to-end recall rate: accurately detect and correctly identify the proportion of text lines in all labeled text lines; End-to-end accuracy rate: accurately detect and correctly identify the number of text lines in the detected text lines The standard for accurate detection is that the IOU of the detection box and the labeled box is greater than a certain threshold, and the text in the correctly identified detection box is the same as the labeled text.
+
+
+
+# 2. Data and vertical scenes
+
+
+
+## 2.1 Training data
+
+The current open source models, data sets and magnitudes are as follows:
+
+- Detection:
+ - English data set, ICDAR2015
+ - Chinese data set, LSVT street view data set training data 3w pictures
+
+- Identification:
+ - English data set, MJSynth and SynthText synthetic data, the data volume is tens of millions.
+ - Chinese data set, LSVT street view data set crops the image according to the truth value, and performs position calibration, a total of 30w images. In addition, based on the LSVT corpus, 500w of synthesized data.
+ - Small language data set, using different corpora and fonts, respectively generated 100w synthetic data set, and using ICDAR-MLT as the verification set.
+
+Among them, the public data sets are all open source, users can search and download by themselves, or refer to [Chinese data set](./datasets.md), synthetic data is not open source, users can use open source synthesis tools to synthesize by themselves. Synthesis tools include [text_renderer](https://github.com/Sanster/text_renderer), [SynthText](https://github.com/ankush-me/SynthText), [TextRecognitionDataGenerator](https://github.com/Belval/TextRecognitionDataGenerator) etc.
+
+
+
+## 2.2 Vertical scene
+
+PaddleOCR mainly focuses on general OCR. If you have vertical requirements, you can use PaddleOCR + vertical data to train yourself;
+If there is a lack of labeled data, or if you do not want to invest in research and development costs, it is recommended to directly call the open API, which covers some of the more common vertical categories.
+
+
+
+## 2.3 Build your own data set
+
+There are several experiences for reference when constructing the data set:
+
+(1) The amount of data in the training set:
+
+ a. The data required for detection is relatively small. For Fine-tune based on the PaddleOCR model, 500 sheets are generally required to achieve good results.
+ b. Recognition is divided into English and Chinese. Generally, English scenarios require hundreds of thousands of data to achieve good results, while Chinese requires several million or more.
+
+
+(2) When the amount of training data is small, you can try the following three ways to get more data:
+
+ a. Manually collect more training data, the most direct and effective way.
+ b. Basic image processing or transformation based on PIL and opencv. For example, the three modules of ImageFont, Image, ImageDraw in PIL write text into the background, opencv's rotating affine transformation, Gaussian filtering and so on.
+ c. Use data generation algorithms to synthesize data, such as algorithms such as pix2pix.
+
+
+
+# 3. FAQ
+
+**Q**: How to choose a suitable network input shape when training CRNN recognition?
+
+ A: The general height is 32, the longest width is selected, there are two methods:
+
+ (1) Calculate the aspect ratio distribution of training sample images. The selection of the maximum aspect ratio considers 80% of the training samples.
+
+ (2) Count the number of texts in training samples. The selection of the longest number of characters considers the training sample that satisfies 80%. Then the aspect ratio of Chinese characters is approximately considered to be 1, and that of English is 3:1, and the longest width is estimated.
+
+**Q**: During the recognition training, the accuracy of the training set has reached 90, but the accuracy of the verification set has been kept at 70, what should I do?
+
+ A: If the accuracy of the training set is 90 and the test set is more than 70, it should be over-fitting. There are two methods to try:
+
+ (1) Add more augmentation methods or increase the [probability] of augmented prob (https://github.com/PaddlePaddle/PaddleOCR/blob/dygraph/ppocr/data/imaug/rec_img_aug.py#L341), The default is 0.4.
+
+ (2) Increase the [l2 dcay value] of the system (https://github.com/PaddlePaddle/PaddleOCR/blob/a501603d54ff5513fc4fc760319472e59da25424/configs/rec/ch_ppocr_v1.1/rec_chinese_lite_train_v1.1.yml#L47)
+
+**Q**: When the recognition model is trained, loss can drop normally, but acc is always 0
+
+ A: It is normal for the acc to be 0 at the beginning of the recognition model training, and the indicator will come up after a longer training period.
+
diff --git a/doc/doc_en/update_en.md b/doc/doc_en/update_en.md
index ca2ecb0535ce27bc7f98a476752a131f869761d5..660688c6d6991a4744dbc327d24e9c677afa0fc1 100644
--- a/doc/doc_en/update_en.md
+++ b/doc/doc_en/update_en.md
@@ -1,4 +1,9 @@
# RECENT UPDATES
+- 2021.9.7 release PaddleOCR v2.3, [PP-OCRv2](#PP-OCRv2) is proposed. The CPU inference speed of PP-OCRv2 is 220% higher than that of PP-OCR server. The F-score of PP-OCRv2 is 7% higher than that of PP-OCR mobile.
+- 2021.8.3 released PaddleOCR v2.2, add a new structured documents analysis toolkit, i.e., [PP-Structure](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.2/ppstructure/README.md), support layout analysis and table recognition (One-key to export chart images to Excel files).
+- 2021.4.8 release end-to-end text recognition algorithm [PGNet](https://www.aaai.org/AAAI21Papers/AAAI-2885.WangP.pdf) which is published in AAAI 2021. Find tutorial [here](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_en/pgnet_en.md);release multi language recognition [models](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_en/multi_languages_en.md), support more than 80 languages recognition; especically, the performance of [English recognition model](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.1/doc/doc_en/models_list_en.md#English) is Optimized.
+
+- 2021.1.21 update more than 25+ multilingual recognition models [models list](./doc/doc_en/models_list_en.md), including:English, Chinese, German, French, Japanese,Spanish,Portuguese Russia Arabic and so on. Models for more languages will continue to be updated [Develop Plan](https://github.com/PaddlePaddle/PaddleOCR/issues/1048).
- 2020.12.15 update Data synthesis tool, i.e., [Style-Text](../../StyleText/README.md),easy to synthesize a large number of images which are similar to the target scene image.
- 2020.11.25 Update a new data annotation tool, i.e., [PPOCRLabel](../../PPOCRLabel/README.md), which is helpful to improve the labeling efficiency. Moreover, the labeling results can be used in training of the PP-OCR system directly.
- 2020.9.22 Update the PP-OCR technical article, https://arxiv.org/abs/2009.09941
diff --git a/doc/doc_en/visualization_en.md b/doc/doc_en/visualization_en.md
index f9c455e5b3510a9f262c6bf59b8adfbaef3fa01d..71cfb043462f34f2b3bef594364d33f15e98d81e 100644
--- a/doc/doc_en/visualization_en.md
+++ b/doc/doc_en/visualization_en.md
@@ -1,5 +1,10 @@
# Visualization
+
+## PP-OCRv2
+
+
+
## ch_ppocr_server_2.0
diff --git a/doc/doc_en/whl_en.md b/doc/doc_en/whl_en.md
index c8c8353accdf7f6ce179d3700547bfe9bd70c200..c2577e1e151e4675abab5139da099db9ad20fb4b 100644
--- a/doc/doc_en/whl_en.md
+++ b/doc/doc_en/whl_en.md
@@ -1,4 +1,4 @@
-# paddleocr package
+# Paddleocr Package
## 1 Get started quickly
### 1.1 install package
diff --git a/doc/ic15_location_download.png b/doc/ic15_location_download.png
new file mode 100644
index 0000000000000000000000000000000000000000..7cb8540e5e51b77aa8b480069841fc51c0d907b7
Binary files /dev/null and b/doc/ic15_location_download.png differ
diff --git a/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic001.jpg b/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic001.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..45ffdb53aa431c8d25cc7219b2c0523690182ab6
Binary files /dev/null and b/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic001.jpg differ
diff --git a/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic002.jpg b/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic002.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..7ac153aee0d703580971539b5cff95587c0e830e
Binary files /dev/null and b/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic002.jpg differ
diff --git a/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic003.jpg b/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic003.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..781aade629651b5adf24fcc76b84a9674154b8b8
Binary files /dev/null and b/doc/imgs_results/PP-OCRv2/PP-OCRv2-pic003.jpg differ
diff --git a/doc/install/linux/anaconda_download.png b/doc/install/linux/anaconda_download.png
new file mode 100755
index 0000000000000000000000000000000000000000..6ab6db30899d8431874e52bbe97af242e638ed6c
Binary files /dev/null and b/doc/install/linux/anaconda_download.png differ
diff --git a/doc/install/linux/conda_create.png b/doc/install/linux/conda_create.png
new file mode 100755
index 0000000000000000000000000000000000000000..533f592b7c1db78699d9166278e91332d3d8f258
Binary files /dev/null and b/doc/install/linux/conda_create.png differ
diff --git a/doc/install/mac/anaconda_start.png b/doc/install/mac/anaconda_start.png
new file mode 100755
index 0000000000000000000000000000000000000000..a860f5e56a76558a764d3d92055743832f4d5acb
Binary files /dev/null and b/doc/install/mac/anaconda_start.png differ
diff --git a/doc/install/mac/conda_activate.png b/doc/install/mac/conda_activate.png
new file mode 100755
index 0000000000000000000000000000000000000000..a2e6074e912988218b62068476b9d5d22deb0d71
Binary files /dev/null and b/doc/install/mac/conda_activate.png differ
diff --git a/doc/install/mac/conda_create.png b/doc/install/mac/conda_create.png
new file mode 100755
index 0000000000000000000000000000000000000000..9ff10c241be39216ea8255826ea50844368f27e8
Binary files /dev/null and b/doc/install/mac/conda_create.png differ
diff --git a/doc/install/windows/Anaconda_download.png b/doc/install/windows/Anaconda_download.png
new file mode 100644
index 0000000000000000000000000000000000000000..83a03414934a12f7071389ef664b6fd5e7df956f
Binary files /dev/null and b/doc/install/windows/Anaconda_download.png differ
diff --git a/doc/install/windows/anaconda_install_env.png b/doc/install/windows/anaconda_install_env.png
new file mode 100644
index 0000000000000000000000000000000000000000..7a22542712a3fa5d471f13d940806d483225c38f
Binary files /dev/null and b/doc/install/windows/anaconda_install_env.png differ
diff --git a/doc/install/windows/anaconda_install_folder.png b/doc/install/windows/anaconda_install_folder.png
new file mode 100644
index 0000000000000000000000000000000000000000..e9fac29eaa92fc445d324a565e95c064a984f9bf
Binary files /dev/null and b/doc/install/windows/anaconda_install_folder.png differ
diff --git a/doc/install/windows/anaconda_prompt.png b/doc/install/windows/anaconda_prompt.png
new file mode 100755
index 0000000000000000000000000000000000000000..1087610ae01f5c6181434e3dcc11189b138d419c
Binary files /dev/null and b/doc/install/windows/anaconda_prompt.png differ
diff --git a/doc/install/windows/conda_list_env.png b/doc/install/windows/conda_list_env.png
new file mode 100644
index 0000000000000000000000000000000000000000..5ffa0037c5e62b75c7b452a4012b7015b03c3f5f
Binary files /dev/null and b/doc/install/windows/conda_list_env.png differ
diff --git a/doc/install/windows/conda_new_env.png b/doc/install/windows/conda_new_env.png
new file mode 100644
index 0000000000000000000000000000000000000000..eed667ec3d4a4419cdfdd842fe57a1efca734c94
Binary files /dev/null and b/doc/install/windows/conda_new_env.png differ
diff --git a/doc/joinus.PNG b/doc/joinus.PNG
index 3be14c603e8fa8c09ac1340fc662ba14ec045f38..6bd6f54d5bd91c55501caaab79a72f7b129fc359 100644
Binary files a/doc/joinus.PNG and b/doc/joinus.PNG differ
diff --git a/doc/overview.png b/doc/overview.png
new file mode 100644
index 0000000000000000000000000000000000000000..c5c4e09d6730bb0b1ca2c0b5442079ceb41ecdfa
Binary files /dev/null and b/doc/overview.png differ
diff --git a/doc/overview_en.png b/doc/overview_en.png
new file mode 100644
index 0000000000000000000000000000000000000000..b44da4e9874d6a2162a8bb05ff1b479875bd65f3
Binary files /dev/null and b/doc/overview_en.png differ
diff --git a/doc/ppocrv2_framework.jpg b/doc/ppocrv2_framework.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..e5f1a2ef47601c3a9eaef43a6046a15ea0319e2b
Binary files /dev/null and b/doc/ppocrv2_framework.jpg differ
diff --git a/paddleocr.py b/paddleocr.py
index 45c1a40dbbe3ad5cba88cadf0ced85717c7a23da..de712442450aaba1176d2cf754de8a429042f84d 100644
--- a/paddleocr.py
+++ b/paddleocr.py
@@ -33,104 +33,141 @@ from tools.infer.utility import draw_ocr, str2bool
from ppstructure.utility import init_args, draw_structure_result
from ppstructure.predict_system import OCRSystem, save_structure_res
-__all__ = ['PaddleOCR', 'PPStructure', 'draw_ocr', 'draw_structure_result', 'save_structure_res','download_with_progressbar']
-
-model_urls = {
- 'det': {
- 'ch':
- 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar',
- 'en':
- 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/en_ppocr_mobile_v2.0_det_infer.tar',
- 'structure': 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar'
+__all__ = [
+ 'PaddleOCR', 'PPStructure', 'draw_ocr', 'draw_structure_result',
+ 'save_structure_res', 'download_with_progressbar'
+]
+
+SUPPORT_DET_MODEL = ['DB']
+VERSION = '2.2.1'
+SUPPORT_REC_MODEL = ['CRNN']
+BASE_DIR = os.path.expanduser("~/.paddleocr/")
+
+DEFAULT_MODEL_VERSION = '2.0'
+MODEL_URLS = {
+ '2.1': {
+ 'det': {
+ 'ch': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_det_infer.tar',
+ },
+ },
+ 'rec': {
+ 'ch': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.1/chinese/ch_ppocr_mobile_v2.1_rec_infer.tar',
+ 'dict_path': './ppocr/utils/ppocr_keys_v1.txt'
+ }
+ }
},
- 'rec': {
- 'ch': {
- 'url':
- 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/ppocr_keys_v1.txt'
+ '2.0': {
+ 'det': {
+ 'ch': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar',
+ },
+ 'en': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/en_ppocr_mobile_v2.0_det_infer.tar',
+ },
+ 'structure': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar'
+ }
},
- 'en': {
- 'url':
+ 'rec': {
+ 'ch': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar',
+ 'dict_path': './ppocr/utils/ppocr_keys_v1.txt'
+ },
+ 'en': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/en_number_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/en_dict.txt'
- },
- 'french': {
- 'url':
+ 'dict_path': './ppocr/utils/en_dict.txt'
+ },
+ 'french': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/french_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/french_dict.txt'
- },
- 'german': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/french_dict.txt'
+ },
+ 'german': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/german_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/german_dict.txt'
- },
- 'korean': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/german_dict.txt'
+ },
+ 'korean': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/korean_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/korean_dict.txt'
- },
- 'japan': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/korean_dict.txt'
+ },
+ 'japan': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/japan_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/japan_dict.txt'
- },
- 'chinese_cht': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/japan_dict.txt'
+ },
+ 'chinese_cht': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/chinese_cht_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/chinese_cht_dict.txt'
- },
- 'ta': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/chinese_cht_dict.txt'
+ },
+ 'ta': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/ta_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/ta_dict.txt'
- },
- 'te': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/ta_dict.txt'
+ },
+ 'te': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/te_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/te_dict.txt'
- },
- 'ka': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/te_dict.txt'
+ },
+ 'ka': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/ka_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/ka_dict.txt'
- },
- 'latin': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/ka_dict.txt'
+ },
+ 'latin': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/latin_ppocr_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/latin_dict.txt'
- },
- 'arabic': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/latin_dict.txt'
+ },
+ 'arabic': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/arabic_ppocr_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/arabic_dict.txt'
- },
- 'cyrillic': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/arabic_dict.txt'
+ },
+ 'cyrillic': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/cyrillic_ppocr_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/cyrillic_dict.txt'
- },
- 'devanagari': {
- 'url':
+ 'dict_path': './ppocr/utils/dict/cyrillic_dict.txt'
+ },
+ 'devanagari': {
+ 'url':
'https://paddleocr.bj.bcebos.com/dygraph_v2.0/multilingual/devanagari_ppocr_mobile_v2.0_rec_infer.tar',
- 'dict_path': './ppocr/utils/dict/devanagari_dict.txt'
+ 'dict_path': './ppocr/utils/dict/devanagari_dict.txt'
+ },
+ 'structure': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_rec_infer.tar',
+ 'dict_path': 'ppocr/utils/dict/table_dict.txt'
+ }
+ },
+ 'cls': {
+ 'ch': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar',
+ }
},
- 'structure': {
- 'url': 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_rec_infer.tar',
- 'dict_path': 'ppocr/utils/dict/table_dict.txt'
+ 'table': {
+ 'en': {
+ 'url':
+ 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar',
+ 'dict_path': 'ppocr/utils/dict/table_structure_dict.txt'
+ }
}
- },
- 'cls': 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar',
- 'table': {
- 'url': 'https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_structure_infer.tar',
- 'dict_path': 'ppocr/utils/dict/table_structure_dict.txt'
}
}
-SUPPORT_DET_MODEL = ['DB']
-VERSION = '2.2.0.1'
-SUPPORT_REC_MODEL = ['CRNN']
-BASE_DIR = os.path.expanduser("~/.paddleocr/")
-
def parse_args(mMain=True):
import argparse
@@ -140,6 +177,7 @@ def parse_args(mMain=True):
parser.add_argument("--det", type=str2bool, default=True)
parser.add_argument("--rec", type=str2bool, default=True)
parser.add_argument("--type", type=str, default='ocr')
+ parser.add_argument("--version", type=str, default='2.1')
for action in parser._actions:
if action.dest in ['rec_char_dict_path', 'table_char_dict_path']:
@@ -155,19 +193,19 @@ def parse_args(mMain=True):
def parse_lang(lang):
latin_lang = [
- 'af', 'az', 'bs', 'cs', 'cy', 'da', 'de', 'es', 'et', 'fr', 'ga',
- 'hr', 'hu', 'id', 'is', 'it', 'ku', 'la', 'lt', 'lv', 'mi', 'ms',
- 'mt', 'nl', 'no', 'oc', 'pi', 'pl', 'pt', 'ro', 'rs_latin', 'sk',
- 'sl', 'sq', 'sv', 'sw', 'tl', 'tr', 'uz', 'vi'
+ 'af', 'az', 'bs', 'cs', 'cy', 'da', 'de', 'es', 'et', 'fr', 'ga', 'hr',
+ 'hu', 'id', 'is', 'it', 'ku', 'la', 'lt', 'lv', 'mi', 'ms', 'mt', 'nl',
+ 'no', 'oc', 'pi', 'pl', 'pt', 'ro', 'rs_latin', 'sk', 'sl', 'sq', 'sv',
+ 'sw', 'tl', 'tr', 'uz', 'vi'
]
arabic_lang = ['ar', 'fa', 'ug', 'ur']
cyrillic_lang = [
- 'ru', 'rs_cyrillic', 'be', 'bg', 'uk', 'mn', 'abq', 'ady', 'kbd',
- 'ava', 'dar', 'inh', 'che', 'lbe', 'lez', 'tab'
+ 'ru', 'rs_cyrillic', 'be', 'bg', 'uk', 'mn', 'abq', 'ady', 'kbd', 'ava',
+ 'dar', 'inh', 'che', 'lbe', 'lez', 'tab'
]
devanagari_lang = [
- 'hi', 'mr', 'ne', 'bh', 'mai', 'ang', 'bho', 'mah', 'sck', 'new',
- 'gom', 'sa', 'bgc'
+ 'hi', 'mr', 'ne', 'bh', 'mai', 'ang', 'bho', 'mah', 'sck', 'new', 'gom',
+ 'sa', 'bgc'
]
if lang in latin_lang:
lang = "latin"
@@ -177,9 +215,9 @@ def parse_lang(lang):
lang = "cyrillic"
elif lang in devanagari_lang:
lang = "devanagari"
- assert lang in model_urls[
+ assert lang in MODEL_URLS[DEFAULT_MODEL_VERSION][
'rec'], 'param lang must in {}, but got {}'.format(
- model_urls['rec'].keys(), lang)
+ MODEL_URLS[DEFAULT_MODEL_VERSION]['rec'].keys(), lang)
if lang == "ch":
det_lang = "ch"
elif lang == 'structure':
@@ -189,6 +227,35 @@ def parse_lang(lang):
return lang, det_lang
+def get_model_config(version, model_type, lang):
+ if version not in MODEL_URLS:
+ logger.warning('version {} not in {}, use version {} instead'.format(
+ version, MODEL_URLS.keys(), DEFAULT_MODEL_VERSION))
+ version = DEFAULT_MODEL_VERSION
+ if model_type not in MODEL_URLS[version]:
+ if model_type in MODEL_URLS[DEFAULT_MODEL_VERSION]:
+ logger.warning(
+ 'version {} not support {} models, use version {} instead'.
+ format(version, model_type, DEFAULT_MODEL_VERSION))
+ version = DEFAULT_MODEL_VERSION
+ else:
+ logger.error('{} models is not support, we only support {}'.format(
+ model_type, MODEL_URLS[DEFAULT_MODEL_VERSION].keys()))
+ sys.exit(-1)
+ if lang not in MODEL_URLS[version][model_type]:
+ if lang in MODEL_URLS[DEFAULT_MODEL_VERSION][model_type]:
+ logger.warning('lang {} is not support in {}, use {} instead'.
+ format(lang, version, DEFAULT_MODEL_VERSION))
+ version = DEFAULT_MODEL_VERSION
+ else:
+ logger.error(
+ 'lang {} is not support, we only support {} for {} models'.
+ format(lang, MODEL_URLS[DEFAULT_MODEL_VERSION][model_type].keys(
+ ), model_type))
+ sys.exit(-1)
+ return MODEL_URLS[version][model_type][lang]
+
+
class PaddleOCR(predict_system.TextSystem):
def __init__(self, **kwargs):
"""
@@ -204,15 +271,21 @@ class PaddleOCR(predict_system.TextSystem):
lang, det_lang = parse_lang(params.lang)
# init model dir
- params.det_model_dir, det_url = confirm_model_dir_url(params.det_model_dir,
- os.path.join(BASE_DIR, VERSION, 'ocr', 'det', det_lang),
- model_urls['det'][det_lang])
- params.rec_model_dir, rec_url = confirm_model_dir_url(params.rec_model_dir,
- os.path.join(BASE_DIR, VERSION, 'ocr', 'rec', lang),
- model_urls['rec'][lang]['url'])
- params.cls_model_dir, cls_url = confirm_model_dir_url(params.cls_model_dir,
- os.path.join(BASE_DIR, VERSION, 'ocr', 'cls'),
- model_urls['cls'])
+ det_model_config = get_model_config(params.version, 'det', det_lang)
+ params.det_model_dir, det_url = confirm_model_dir_url(
+ params.det_model_dir,
+ os.path.join(BASE_DIR, VERSION, 'ocr', 'det', det_lang),
+ det_model_config['url'])
+ rec_model_config = get_model_config(params.version, 'rec', lang)
+ params.rec_model_dir, rec_url = confirm_model_dir_url(
+ params.rec_model_dir,
+ os.path.join(BASE_DIR, VERSION, 'ocr', 'rec', lang),
+ rec_model_config['url'])
+ cls_model_config = get_model_config(params.version, 'cls', 'ch')
+ params.cls_model_dir, cls_url = confirm_model_dir_url(
+ params.cls_model_dir,
+ os.path.join(BASE_DIR, VERSION, 'ocr', 'cls'),
+ cls_model_config['url'])
# download model
maybe_download(params.det_model_dir, det_url)
maybe_download(params.rec_model_dir, rec_url)
@@ -226,7 +299,8 @@ class PaddleOCR(predict_system.TextSystem):
sys.exit(0)
if params.rec_char_dict_path is None:
- params.rec_char_dict_path = str(Path(__file__).parent / model_urls['rec'][lang]['dict_path'])
+ params.rec_char_dict_path = str(
+ Path(__file__).parent / rec_model_config['dict_path'])
print(params)
# init det_model and rec_model
@@ -293,24 +367,32 @@ class PPStructure(OCRSystem):
lang, det_lang = parse_lang(params.lang)
# init model dir
- params.det_model_dir, det_url = confirm_model_dir_url(params.det_model_dir,
- os.path.join(BASE_DIR, VERSION, 'ocr', 'det', det_lang),
- model_urls['det'][det_lang])
- params.rec_model_dir, rec_url = confirm_model_dir_url(params.rec_model_dir,
- os.path.join(BASE_DIR, VERSION, 'ocr', 'rec', lang),
- model_urls['rec'][lang]['url'])
- params.table_model_dir, table_url = confirm_model_dir_url(params.table_model_dir,
- os.path.join(BASE_DIR, VERSION, 'ocr', 'table'),
- model_urls['table']['url'])
+ det_model_config = get_model_config(params.version, 'det', det_lang)
+ params.det_model_dir, det_url = confirm_model_dir_url(
+ params.det_model_dir,
+ os.path.join(BASE_DIR, VERSION, 'ocr', 'det', det_lang),
+ det_model_config['url'])
+ rec_model_config = get_model_config(params.version, 'rec', lang)
+ params.rec_model_dir, rec_url = confirm_model_dir_url(
+ params.rec_model_dir,
+ os.path.join(BASE_DIR, VERSION, 'ocr', 'rec', lang),
+ rec_model_config['url'])
+ table_model_config = get_model_config(params.version, 'table', 'en')
+ params.table_model_dir, table_url = confirm_model_dir_url(
+ params.table_model_dir,
+ os.path.join(BASE_DIR, VERSION, 'ocr', 'table'),
+ table_model_config['url'])
# download model
maybe_download(params.det_model_dir, det_url)
maybe_download(params.rec_model_dir, rec_url)
maybe_download(params.table_model_dir, table_url)
if params.rec_char_dict_path is None:
- params.rec_char_dict_path = str(Path(__file__).parent / model_urls['rec'][lang]['dict_path'])
+ params.rec_char_dict_path = str(
+ Path(__file__).parent / rec_model_config['dict_path'])
if params.table_char_dict_path is None:
- params.table_char_dict_path = str(Path(__file__).parent / model_urls['table']['dict_path'])
+ params.table_char_dict_path = str(
+ Path(__file__).parent / table_model_config['dict_path'])
print(params)
super().__init__(params)
@@ -374,4 +456,3 @@ def main():
for item in result:
item.pop('img')
logger.info(item)
-
diff --git a/ppstructure/README.md b/ppstructure/README.md
index a00d12d8edbf5bd20a5c7efd41cf69809861ea31..849c5c5667ff0532dfee35479715880192df0dc5 100644
--- a/ppstructure/README.md
+++ b/ppstructure/README.md
@@ -124,8 +124,6 @@ Most of the parameters are consistent with the paddleocr whl package, see [doc o
After running, each image will have a directory with the same name under the directory specified in the output field. Each table in the picture will be stored as an excel and figure area will be cropped and saved, the excel and image file name will be the coordinates of the table in the image.
## 4. PP-Structure Pipeline
-
-the process is as follows
![pipeline](../doc/table/pipeline_en.jpg)
In PP-Structure, the image will be analyzed by layoutparser first. In the layout analysis, the area in the image will be classified, including **text, title, image, list and table** 5 categories. For the first 4 types of areas, directly use the PP-OCR to complete the text detection and recognition. The table area will be converted to an excel file of the same table style via Table OCR.
diff --git a/tests/compare_results.py b/tests/compare_results.py
new file mode 100644
index 0000000000000000000000000000000000000000..1c3fe4ea951aef122728a7aed7fc4ecaf8e7607e
--- /dev/null
+++ b/tests/compare_results.py
@@ -0,0 +1,133 @@
+import numpy as np
+import os
+import subprocess
+import json
+import argparse
+import glob
+
+
+def init_args():
+ parser = argparse.ArgumentParser()
+ # params for testing assert allclose
+ parser.add_argument("--atol", type=float, default=1e-3)
+ parser.add_argument("--rtol", type=float, default=1e-3)
+ parser.add_argument("--gt_file", type=str, default="")
+ parser.add_argument("--log_file", type=str, default="")
+ parser.add_argument("--precision", type=str, default="fp32")
+ return parser
+
+
+def parse_args():
+ parser = init_args()
+ return parser.parse_args()
+
+
+def run_shell_command(cmd):
+ p = subprocess.Popen(
+ cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
+ out, err = p.communicate()
+
+ if p.returncode == 0:
+ return out.decode('utf-8')
+ else:
+ return None
+
+
+def parser_results_from_log_by_name(log_path, names_list):
+ if not os.path.exists(log_path):
+ raise ValueError("The log file {} does not exists!".format(log_path))
+
+ if names_list is None or len(names_list) < 1:
+ return []
+
+ parser_results = {}
+ for name in names_list:
+ cmd = "grep {} {}".format(name, log_path)
+ outs = run_shell_command(cmd)
+ outs = outs.split("\n")[0]
+ result = outs.split("{}".format(name))[-1]
+ result = json.loads(result)
+ parser_results[name] = result
+ return parser_results
+
+
+def load_gt_from_file(gt_file):
+ if not os.path.exists(gt_file):
+ raise ValueError("The log file {} does not exists!".format(gt_file))
+ with open(gt_file, 'r') as f:
+ data = f.readlines()
+ f.close()
+ parser_gt = {}
+ for line in data:
+ image_name, result = line.strip("\n").split("\t")
+ result = json.loads(result)
+ parser_gt[image_name] = result
+ return parser_gt
+
+
+def load_gt_from_txts(gt_file):
+ gt_list = glob.glob(gt_file)
+ gt_collection = {}
+ for gt_f in gt_list:
+ gt_dict = load_gt_from_file(gt_f)
+ basename = os.path.basename(gt_f)
+ if "fp32" in basename:
+ gt_collection["fp32"] = [gt_dict, gt_f]
+ elif "fp16" in basename:
+ gt_collection["fp16"] = [gt_dict, gt_f]
+ elif "int8" in basename:
+ gt_collection["int8"] = [gt_dict, gt_f]
+ else:
+ continue
+ return gt_collection
+
+
+def collect_predict_from_logs(log_path, key_list):
+ log_list = glob.glob(log_path)
+ pred_collection = {}
+ for log_f in log_list:
+ pred_dict = parser_results_from_log_by_name(log_f, key_list)
+ key = os.path.basename(log_f)
+ pred_collection[key] = pred_dict
+
+ return pred_collection
+
+
+def testing_assert_allclose(dict_x, dict_y, atol=1e-7, rtol=1e-7):
+ for k in dict_x:
+ np.testing.assert_allclose(
+ np.array(dict_x[k]), np.array(dict_y[k]), atol=atol, rtol=rtol)
+
+
+if __name__ == "__main__":
+ # Usage:
+ # python3.7 tests/compare_results.py --gt_file=./tests/results/*.txt --log_file=./tests/output/infer_*.log
+
+ args = parse_args()
+
+ gt_collection = load_gt_from_txts(args.gt_file)
+ key_list = gt_collection["fp32"][0].keys()
+
+ pred_collection = collect_predict_from_logs(args.log_file, key_list)
+ for filename in pred_collection.keys():
+ if "fp32" in filename:
+ gt_dict, gt_filename = gt_collection["fp32"]
+ elif "fp16" in filename:
+ gt_dict, gt_filename = gt_collection["fp16"]
+ elif "int8" in filename:
+ gt_dict, gt_filename = gt_collection["int8"]
+ else:
+ continue
+ pred_dict = pred_collection[filename]
+
+ try:
+ testing_assert_allclose(
+ gt_dict, pred_dict, atol=args.atol, rtol=args.rtol)
+ print(
+ "Assert allclose passed! The results of {} and {} are consistent!".
+ format(filename, gt_filename))
+ except Exception as E:
+ print(E)
+ raise ValueError(
+ "The results of {} and the results of {} are inconsistent!".
+ format(filename, gt_filename))
diff --git a/tests/results/det_results_gpu_fp32.txt b/tests/results/det_results_gpu_fp32.txt
new file mode 100644
index 0000000000000000000000000000000000000000..28af26d0b2178802baf45c58586d38f9eeffe820
--- /dev/null
+++ b/tests/results/det_results_gpu_fp32.txt
@@ -0,0 +1,49 @@
+00008790.jpg [[[209, 406], [280, 406], [280, 419], [209, 419]], [[60, 398], [105, 398], [105, 411], [60, 411]], [[198, 389], [291, 389], [291, 402], [198, 402]], [[162, 391], [173, 391], [173, 401], [162, 401]], [[35, 380], [133, 380], [133, 393], [35, 393]], [[199, 371], [292, 371], [292, 384], [199, 384]], [[218, 310], [272, 310], [272, 324], [218, 324]], [[162, 305], [172, 305], [172, 314], [162, 314]], [[371, 302], [436, 302], [436, 316], [371, 316]], [[31, 302], [134, 301], [134, 315], [31, 316]], [[223, 292], [269, 292], [269, 306], [223, 306]], [[60, 225], [104, 225], [104, 236], [60, 236]], [[218, 223], [272, 223], [272, 237], [218, 237]], [[162, 219], [173, 219], [173, 227], [162, 227]], [[33, 207], [131, 207], [131, 220], [33, 220]], [[223, 206], [269, 206], [269, 220], [223, 220]], [[74, 146], [383, 146], [383, 159], [74, 159]], [[54, 120], [117, 120], [117, 134], [54, 134]], [[74, 51], [296, 51], [296, 65], [74, 65]], [[56, 18], [116, 18], [116, 32], [56, 32]]]
+00018946.jpg [[[441, 328], [474, 328], [474, 339], [441, 339]], [[86, 284], [141, 286], [140, 307], [85, 305]], [[302, 279], [377, 279], [377, 297], [302, 297]], [[197, 265], [281, 274], [279, 293], [195, 284]], [[198, 197], [452, 219], [450, 242], [196, 220]], [[343, 182], [376, 182], [376, 192], [343, 192]], [[199, 164], [340, 171], [339, 192], [198, 185]], [[177, 101], [415, 118], [413, 145], [175, 128]]]
+00034387.jpg [[[265, 460], [740, 460], [740, 484], [265, 484]], [[348, 417], [420, 417], [420, 443], [348, 443]], [[545, 418], [568, 418], [568, 442], [545, 442]], [[685, 417], [710, 417], [710, 443], [685, 443]], [[175, 415], [226, 415], [226, 443], [175, 443]], [[874, 414], [908, 414], [908, 446], [874, 446]], [[56, 417], [74, 417], [74, 442], [56, 442]], [[856, 373], [925, 373], [925, 400], [856, 400]], [[348, 372], [418, 372], [418, 397], [348, 397]], [[674, 372], [723, 372], [723, 401], [674, 401]], [[539, 373], [570, 373], [570, 400], [539, 400]], [[151, 365], [228, 369], [226, 402], [149, 398]], [[56, 372], [74, 372], [74, 397], [56, 397]], [[857, 329], [925, 329], [925, 355], [857, 355]], [[351, 330], [419, 330], [419, 356], [351, 356]], [[674, 328], [723, 328], [723, 356], [674, 356]], [[541, 329], [570, 329], [570, 357], [541, 357]], [[171, 327], [227, 324], [229, 355], [173, 358]], [[57, 330], [74, 330], [74, 356], [57, 356]], [[298, 327], [316, 327], [316, 334], [298, 334]], [[855, 286], [925, 286], [925, 312], [855, 312]], [[674, 286], [723, 286], [723, 313], [674, 313]], [[346, 286], [426, 283], [427, 313], [347, 316]], [[540, 285], [569, 285], [569, 312], [540, 312]], [[172, 282], [226, 282], [226, 313], [172, 313]], [[56, 287], [73, 287], [73, 312], [56, 312]], [[857, 242], [925, 242], [925, 268], [857, 268]], [[348, 242], [460, 242], [460, 268], [348, 268]], [[156, 242], [227, 242], [227, 269], [156, 269]], [[674, 241], [724, 241], [724, 269], [674, 269]], [[531, 241], [572, 241], [572, 270], [531, 270]], [[56, 242], [74, 242], [74, 268], [56, 268]], [[855, 197], [925, 200], [924, 226], [854, 224]], [[674, 198], [726, 198], [726, 226], [674, 226]], [[344, 200], [434, 195], [436, 223], [346, 228]], [[176, 197], [227, 197], [227, 225], [176, 225]], [[56, 200], [73, 200], [73, 226], [56, 226]], [[527, 194], [576, 194], [576, 226], [527, 226]], [[349, 155], [419, 155], [419, 181], [349, 181]], [[854, 154], [925, 154], [925, 180], [854, 180]], [[176, 154], [226, 154], [226, 183], [176, 183]], [[670, 153], [723, 153], [723, 181], [670, 181]], [[538, 154], [571, 154], [571, 182], [538, 182]], [[56, 156], [74, 156], [74, 182], [56, 182]], [[349, 111], [419, 111], [419, 137], [349, 137]], [[174, 111], [227, 111], [227, 139], [174, 139]], [[546, 113], [564, 113], [564, 137], [546, 137]], [[52, 112], [75, 112], [75, 139], [52, 139]], [[639, 108], [727, 105], [728, 138], [640, 141]], [[817, 103], [927, 110], [925, 139], [815, 132]], [[814, 68], [951, 68], [951, 92], [814, 92]], [[307, 66], [446, 68], [446, 93], [306, 90]], [[673, 67], [723, 67], [723, 93], [673, 93]], [[175, 65], [228, 68], [226, 95], [174, 92]], [[39, 65], [90, 68], [88, 97], [37, 94]], [[528, 65], [580, 65], [580, 94], [528, 94]], [[334, 20], [670, 20], [670, 43], [334, 43]]]
+00037951.jpg [[[434, 976], [551, 978], [550, 993], [434, 991]], [[433, 932], [553, 932], [553, 969], [433, 969]], [[30, 522], [98, 522], [98, 545], [30, 545]], [[31, 443], [145, 443], [145, 464], [31, 464]], [[234, 335], [326, 332], [327, 354], [235, 356]], [[124, 252], [436, 252], [436, 284], [124, 284]], [[182, 206], [378, 206], [378, 227], [182, 227]], [[258, 106], [320, 123], [304, 181], [242, 163]], [[28, 65], [33, 65], [33, 71], [28, 71]], [[37, 58], [147, 58], [147, 80], [37, 80]]]
+00044782.jpg [[[104, 218], [115, 218], [115, 227], [104, 227]], [[223, 216], [246, 216], [246, 228], [223, 228]], [[163, 216], [182, 216], [182, 229], [163, 229]], [[124, 191], [164, 191], [164, 202], [124, 202]], [[91, 84], [251, 84], [251, 98], [91, 98]], [[73, 63], [278, 63], [278, 78], [73, 78]], [[104, 15], [243, 15], [243, 44], [104, 44]]]
+00067516.jpg [[[141, 808], [594, 809], [594, 822], [141, 821]], [[49, 784], [696, 784], [696, 798], [49, 798]], [[579, 751], [667, 751], [667, 764], [579, 764]], [[355, 750], [395, 750], [395, 767], [355, 767]], [[221, 751], [260, 751], [260, 765], [221, 765]], [[477, 750], [501, 750], [501, 768], [477, 768]], [[69, 748], [133, 751], [132, 765], [68, 761]], [[576, 682], [668, 682], [668, 699], [576, 699]], [[476, 682], [518, 682], [518, 700], [476, 700]], [[354, 682], [395, 682], [395, 700], [354, 700]], [[69, 681], [133, 684], [132, 699], [68, 695]], [[220, 679], [243, 682], [241, 700], [218, 697]], [[577, 615], [667, 615], [667, 632], [577, 632]], [[68, 612], [134, 615], [133, 632], [67, 629]], [[476, 614], [500, 614], [500, 633], [476, 633]], [[354, 613], [378, 613], [378, 634], [354, 634]], [[219, 612], [245, 612], [245, 633], [219, 633]], [[578, 547], [667, 547], [667, 564], [578, 564]], [[476, 546], [518, 546], [518, 565], [476, 565]], [[353, 545], [379, 545], [379, 566], [353, 566]], [[219, 545], [245, 545], [245, 566], [219, 566]], [[68, 542], [133, 546], [132, 563], [67, 560]], [[68, 478], [133, 482], [132, 499], [67, 496]], [[586, 481], [664, 481], [664, 497], [586, 497]], [[476, 480], [518, 480], [518, 498], [476, 498]], [[354, 480], [395, 480], [395, 498], [354, 498]], [[219, 479], [245, 479], [245, 500], [219, 500]], [[580, 425], [665, 429], [664, 449], [580, 446]], [[346, 429], [410, 429], [410, 447], [346, 447]], [[68, 426], [150, 429], [149, 449], [67, 447]], [[474, 427], [515, 427], [515, 449], [474, 449]], [[218, 427], [259, 427], [259, 449], [218, 449]], [[283, 398], [478, 399], [478, 419], [283, 418]], [[86, 318], [664, 318], [664, 332], [86, 332]], [[65, 279], [665, 279], [665, 292], [65, 292]], [[458, 210], [584, 210], [584, 224], [458, 224]], [[313, 209], [372, 209], [372, 226], [313, 226]], [[164, 209], [225, 209], [225, 226], [164, 226]], [[505, 151], [539, 151], [539, 166], [505, 166]], [[266, 48], [483, 48], [483, 68], [266, 68]]]
+00088568.jpg [[[341, 446], [371, 446], [371, 453], [341, 453]], [[58, 445], [117, 445], [117, 455], [58, 455]], [[552, 433], [571, 433], [571, 440], [552, 440]], [[583, 431], [740, 431], [740, 442], [583, 442]], [[311, 415], [743, 415], [743, 428], [311, 428]], [[311, 377], [736, 377], [736, 390], [311, 390]], [[425, 340], [551, 340], [551, 350], [425, 350]], [[287, 324], [294, 332], [289, 337], [281, 330]], [[276, 294], [348, 296], [347, 311], [276, 309]], [[54, 288], [210, 288], [210, 301], [54, 301]], [[275, 265], [421, 265], [421, 278], [275, 278]], [[56, 264], [248, 264], [248, 277], [56, 277]], [[671, 248], [695, 248], [695, 261], [671, 261]], [[602, 248], [628, 248], [628, 261], [602, 261]], [[533, 248], [557, 248], [557, 261], [533, 261]], [[463, 248], [487, 248], [487, 261], [463, 261]], [[278, 248], [309, 248], [309, 260], [278, 260]], [[55, 240], [142, 240], [142, 254], [55, 254]], [[277, 231], [398, 231], [398, 244], [277, 244]], [[741, 228], [749, 237], [742, 245], [733, 236]], [[665, 230], [700, 230], [700, 244], [665, 244]], [[598, 230], [631, 230], [631, 244], [598, 244]], [[528, 230], [562, 230], [562, 244], [528, 244]], [[459, 230], [492, 230], [492, 244], [459, 244]], [[54, 215], [211, 217], [211, 231], [54, 229]], [[739, 211], [749, 221], [740, 229], [731, 220]], [[663, 214], [704, 214], [704, 228], [663, 228]], [[595, 215], [637, 215], [637, 226], [595, 226]], [[524, 215], [569, 215], [569, 226], [524, 226]], [[454, 215], [495, 215], [495, 226], [454, 226]], [[279, 215], [351, 215], [351, 226], [279, 226]], [[736, 199], [747, 199], [747, 208], [736, 208]], [[668, 197], [700, 197], [700, 208], [668, 208]], [[599, 196], [633, 196], [633, 210], [599, 210]], [[529, 197], [562, 197], [562, 208], [529, 208]], [[461, 197], [491, 197], [491, 208], [461, 208]], [[277, 195], [417, 196], [417, 211], [277, 209]], [[55, 192], [239, 192], [239, 205], [55, 205]], [[665, 181], [703, 181], [703, 192], [665, 192]], [[279, 180], [351, 181], [350, 192], [279, 191]], [[734, 180], [747, 180], [747, 193], [734, 193]], [[597, 180], [634, 180], [634, 191], [597, 191]], [[525, 179], [566, 179], [566, 193], [525, 193]], [[458, 180], [493, 180], [493, 191], [458, 191]], [[55, 170], [142, 170], [142, 184], [55, 184]], [[735, 165], [747, 165], [747, 175], [735, 175]], [[665, 163], [703, 163], [703, 175], [665, 175]], [[598, 163], [634, 163], [634, 175], [598, 175]], [[527, 163], [565, 163], [565, 175], [527, 175]], [[458, 163], [492, 163], [492, 175], [458, 175]], [[279, 162], [398, 162], [398, 176], [279, 176]], [[54, 146], [148, 146], [148, 159], [54, 159]], [[453, 147], [495, 147], [495, 158], [453, 158]], [[731, 143], [748, 146], [745, 161], [728, 158]], [[663, 145], [704, 145], [704, 159], [663, 159]], [[596, 146], [635, 146], [635, 157], [596, 157]], [[522, 145], [566, 142], [567, 157], [523, 159]], [[277, 144], [310, 144], [310, 158], [277, 158]], [[276, 121], [428, 121], [428, 139], [276, 139]], [[52, 120], [232, 121], [232, 139], [52, 138]], [[404, 91], [701, 91], [701, 106], [404, 106]], [[48, 79], [280, 79], [280, 97], [48, 97]], [[325, 69], [744, 70], [744, 84], [325, 83]], [[668, 48], [743, 48], [743, 63], [668, 63]], [[297, 48], [433, 48], [433, 62], [297, 62]]]
+00091741.jpg [[[47, 336], [83, 336], [83, 358], [47, 358]], [[99, 211], [257, 211], [257, 230], [99, 230]], [[103, 190], [257, 191], [257, 205], [103, 204]], [[89, 101], [266, 99], [267, 181], [90, 184]], [[94, 48], [262, 55], [260, 114], [91, 107]], [[91, 12], [257, 14], [257, 37], [90, 35]]]
+00105313.jpg [[[291, 262], [406, 262], [406, 275], [291, 275]], [[153, 262], [264, 262], [264, 274], [153, 274]], [[11, 258], [73, 261], [72, 274], [11, 272]], [[33, 231], [132, 231], [132, 244], [33, 244]], [[35, 217], [216, 217], [216, 227], [35, 227]], [[33, 200], [146, 200], [146, 213], [33, 213]], [[32, 183], [215, 184], [215, 197], [32, 196]], [[35, 170], [105, 170], [105, 181], [35, 181]], [[35, 155], [124, 155], [124, 164], [35, 164]], [[34, 137], [142, 138], [142, 149], [34, 148]], [[35, 123], [176, 123], [176, 133], [35, 133]], [[33, 106], [176, 106], [176, 119], [33, 119]], [[34, 92], [102, 92], [102, 102], [34, 102]], [[34, 77], [119, 77], [119, 87], [34, 87]], [[32, 60], [120, 60], [120, 73], [32, 73]], [[35, 46], [119, 46], [119, 55], [35, 55]], [[32, 29], [142, 29], [142, 42], [32, 42]], [[25, 12], [147, 12], [147, 24], [25, 24]]]
+00134770.jpg [[[388, 646], [456, 646], [456, 656], [388, 656]], [[407, 620], [484, 619], [485, 633], [408, 634]], [[112, 534], [270, 531], [270, 549], [113, 551]], [[111, 502], [443, 497], [443, 514], [112, 519]], [[111, 471], [443, 467], [443, 484], [112, 488]], [[111, 439], [444, 434], [444, 451], [112, 457]], [[111, 409], [442, 405], [442, 421], [112, 425]], [[153, 376], [441, 373], [441, 390], [153, 394]], [[184, 338], [369, 336], [369, 356], [185, 358]], [[75, 98], [515, 104], [513, 218], [74, 212]]]
+00145943.jpg [[[394, 248], [746, 279], [731, 449], [379, 418]], [[90, 92], [300, 92], [300, 119], [90, 119]], [[46, 41], [326, 39], [326, 75], [46, 77]]]
+00147605.jpg [[[804, 615], [874, 616], [874, 627], [804, 626]], [[516, 607], [784, 605], [784, 628], [516, 629]], [[118, 522], [224, 522], [224, 560], [118, 560]], [[253, 524], [307, 524], [307, 557], [253, 557]], [[715, 501], [900, 505], [900, 538], [714, 534]], [[255, 502], [295, 502], [295, 517], [255, 517]], [[347, 481], [473, 481], [473, 515], [347, 515]], [[252, 484], [295, 484], [295, 499], [252, 499]], [[350, 456], [447, 456], [447, 470], [350, 470]], [[145, 444], [201, 444], [201, 467], [145, 467]], [[728, 371], [878, 371], [878, 420], [728, 420]], [[528, 369], [681, 369], [681, 418], [528, 418]], [[143, 369], [488, 369], [488, 420], [143, 420]], [[744, 315], [871, 315], [871, 336], [744, 336]], [[799, 157], [886, 154], [887, 188], [800, 191]], [[274, 142], [455, 142], [455, 160], [274, 160]], [[738, 116], [894, 119], [893, 157], [737, 153]], [[108, 112], [204, 112], [204, 130], [108, 130]], [[270, 92], [463, 96], [462, 132], [270, 129]]]
+00150341.jpg [[[100, 645], [298, 645], [298, 662], [100, 662]], [[115, 617], [288, 617], [288, 631], [115, 631]], [[84, 593], [319, 592], [319, 609], [84, 610]], [[31, 565], [313, 562], [314, 580], [31, 582]], [[444, 560], [461, 560], [461, 569], [444, 569]], [[390, 557], [446, 557], [446, 572], [390, 572]], [[31, 515], [168, 515], [168, 529], [31, 529]], [[33, 490], [110, 490], [110, 504], [33, 504]], [[358, 459], [464, 463], [463, 485], [357, 481]], [[28, 459], [268, 460], [268, 481], [28, 480]], [[339, 439], [421, 444], [421, 460], [338, 455]], [[65, 439], [143, 439], [143, 453], [65, 453]], [[207, 416], [292, 416], [292, 434], [207, 434]], [[319, 408], [441, 413], [440, 438], [318, 433]], [[44, 405], [175, 409], [174, 434], [43, 430]], [[31, 383], [137, 383], [137, 404], [31, 404]]]
+00150669.jpg [[[649, 700], [681, 700], [681, 716], [649, 716]], [[517, 685], [549, 685], [549, 720], [517, 720]], [[651, 688], [678, 688], [678, 701], [651, 701]], [[862, 687], [876, 687], [876, 695], [862, 695]], [[922, 675], [938, 675], [938, 685], [922, 685]], [[785, 671], [807, 671], [807, 687], [785, 687]], [[592, 672], [606, 672], [606, 686], [592, 686]], [[722, 679], [732, 669], [742, 678], [731, 688]], [[651, 680], [667, 665], [681, 679], [666, 695]], [[273, 667], [422, 667], [422, 688], [273, 688]], [[136, 666], [203, 666], [203, 688], [136, 688]], [[46, 666], [109, 666], [109, 687], [46, 687]], [[782, 629], [810, 629], [810, 661], [782, 661]], [[645, 627], [685, 627], [685, 665], [645, 665]], [[516, 628], [548, 628], [548, 664], [516, 664]], [[655, 619], [672, 619], [672, 627], [655, 627]], [[598, 617], [605, 624], [599, 629], [592, 622]], [[523, 619], [540, 619], [540, 627], [523, 627]], [[858, 618], [868, 618], [868, 627], [858, 627]], [[727, 618], [735, 618], [735, 627], [727, 627]], [[919, 620], [932, 611], [942, 624], [929, 633]], [[786, 616], [805, 616], [805, 629], [786, 629]], [[373, 604], [420, 604], [420, 619], [373, 619]], [[85, 603], [215, 605], [214, 621], [84, 619]], [[48, 603], [71, 603], [71, 622], [48, 622]], [[788, 561], [806, 561], [806, 572], [788, 572]], [[923, 560], [935, 560], [935, 574], [923, 574]], [[856, 560], [869, 560], [869, 574], [856, 574]], [[62, 554], [410, 554], [410, 568], [62, 568]], [[63, 532], [116, 535], [115, 545], [62, 543]], [[859, 527], [868, 527], [868, 539], [859, 539]], [[925, 526], [934, 526], [934, 540], [925, 540]], [[794, 520], [807, 529], [798, 542], [785, 533]], [[526, 526], [535, 526], [535, 536], [526, 536]], [[262, 513], [395, 513], [395, 526], [262, 526]], [[122, 514], [245, 514], [245, 524], [122, 524]], [[49, 514], [119, 514], [119, 525], [49, 525]], [[755, 492], [828, 492], [828, 507], [755, 507]], [[638, 492], [710, 492], [710, 507], [638, 507]], [[519, 492], [592, 492], [592, 507], [519, 507]], [[85, 450], [123, 450], [123, 461], [85, 461]], [[220, 450], [236, 447], [238, 459], [223, 462]], [[683, 445], [868, 445], [868, 459], [683, 459]], [[562, 445], [666, 445], [666, 459], [562, 459]], [[491, 446], [544, 446], [544, 458], [491, 458]], [[183, 437], [208, 437], [208, 459], [183, 459]], [[52, 431], [72, 438], [64, 462], [44, 455]], [[224, 432], [276, 432], [276, 443], [224, 443]], [[88, 432], [144, 432], [144, 443], [88, 443]], [[506, 383], [616, 382], [616, 397], [506, 398]], [[702, 381], [758, 381], [758, 399], [702, 399]], [[308, 373], [364, 373], [364, 384], [308, 384]], [[92, 373], [167, 373], [167, 384], [92, 384]], [[688, 335], [820, 335], [820, 350], [688, 350]], [[498, 335], [657, 335], [657, 350], [498, 350]], [[208, 316], [244, 316], [244, 331], [208, 331]], [[499, 289], [641, 289], [641, 302], [499, 302]], [[671, 287], [801, 287], [801, 301], [671, 301]], [[670, 241], [816, 241], [816, 255], [670, 255]], [[497, 241], [643, 241], [643, 255], [497, 255]], [[670, 194], [815, 194], [815, 208], [670, 208]], [[498, 194], [643, 194], [643, 208], [498, 208]], [[670, 145], [815, 145], [815, 160], [670, 160]], [[499, 145], [645, 145], [645, 160], [499, 160]], [[489, 103], [546, 103], [546, 120], [489, 120]], [[56, 89], [95, 89], [95, 97], [56, 97]], [[845, 26], [887, 20], [889, 39], [848, 44]], [[26, 20], [700, 20], [700, 37], [26, 37]], [[898, 11], [996, 16], [995, 45], [896, 40]]]
+00152568.jpg [[[3, 252], [284, 254], [284, 280], [3, 278]], [[196, 233], [254, 233], [254, 240], [196, 240]], [[49, 229], [90, 229], [90, 240], [49, 240]], [[200, 159], [281, 165], [276, 229], [195, 222]]]
+00155628.jpg [[[149, 901], [503, 903], [503, 922], [149, 920]], [[520, 893], [561, 896], [560, 911], [519, 908]], [[61, 885], [81, 885], [81, 894], [61, 894]], [[150, 878], [503, 882], [503, 900], [149, 896]], [[524, 834], [640, 839], [639, 856], [524, 852]], [[70, 834], [185, 835], [185, 853], [69, 852]], [[246, 555], [466, 555], [466, 569], [246, 569]], [[308, 507], [403, 509], [403, 524], [308, 522]], [[244, 482], [459, 484], [459, 502], [244, 500]], [[252, 422], [459, 424], [458, 452], [251, 450]], [[195, 378], [517, 380], [516, 408], [195, 406]], [[474, 194], [624, 196], [624, 210], [473, 208]], [[73, 129], [641, 131], [641, 160], [73, 158]], [[483, 41], [597, 37], [599, 98], [486, 102]], [[68, 25], [135, 16], [139, 43], [72, 52]]]
+00173364.jpg [[[8, 178], [57, 178], [57, 200], [8, 200]], [[137, 120], [194, 120], [194, 133], [137, 133]], [[39, 76], [86, 76], [86, 105], [39, 105]], [[249, 20], [310, 20], [310, 36], [249, 36]], [[21, 16], [104, 16], [104, 39], [21, 39]]]
+00175503.jpg [[[43, 260], [500, 255], [501, 358], [44, 363]], [[52, 200], [349, 178], [354, 251], [58, 273]]]
+00193218.jpg [[[283, 375], [410, 375], [410, 388], [283, 388]], [[172, 375], [221, 375], [221, 389], [172, 389]], [[110, 375], [161, 375], [161, 389], [110, 389]], [[276, 358], [357, 358], [357, 371], [276, 371]], [[171, 359], [220, 359], [220, 370], [171, 370]], [[409, 357], [492, 357], [492, 370], [409, 370]], [[26, 187], [62, 187], [62, 202], [26, 202]], [[501, 185], [557, 185], [557, 199], [501, 199]], [[381, 187], [420, 185], [421, 199], [382, 201]], [[284, 186], [310, 186], [310, 201], [284, 201]], [[174, 186], [196, 186], [196, 201], [174, 201]], [[499, 165], [540, 165], [540, 176], [499, 176]], [[381, 164], [409, 164], [409, 177], [381, 177]], [[262, 163], [302, 163], [302, 177], [262, 177]], [[176, 163], [230, 163], [230, 177], [176, 177]], [[26, 163], [79, 163], [79, 177], [26, 177]], [[387, 140], [488, 140], [488, 153], [387, 153]], [[28, 139], [131, 139], [131, 152], [28, 152]], [[443, 117], [537, 119], [537, 133], [443, 132]], [[346, 119], [405, 119], [405, 130], [346, 130]], [[261, 119], [302, 119], [302, 130], [261, 130]], [[30, 113], [228, 116], [228, 131], [30, 129]], [[131, 91], [394, 94], [394, 109], [131, 105]], [[562, 82], [583, 82], [583, 107], [562, 107]]]
+00195033.jpg [[[488, 263], [533, 265], [532, 280], [487, 278]], [[126, 250], [192, 250], [192, 283], [126, 283]], [[338, 249], [362, 249], [362, 266], [338, 266]], [[319, 222], [380, 225], [380, 238], [319, 236]], [[431, 224], [450, 224], [450, 235], [431, 235]], [[365, 203], [538, 203], [538, 216], [365, 216]], [[89, 200], [146, 203], [146, 217], [89, 214]], [[329, 201], [354, 201], [354, 212], [329, 212]], [[371, 181], [449, 181], [449, 194], [371, 194]], [[329, 181], [352, 181], [352, 192], [329, 192]], [[96, 179], [240, 179], [240, 193], [96, 193]], [[456, 162], [555, 162], [555, 175], [456, 175]], [[129, 150], [287, 151], [287, 165], [129, 164]], [[36, 145], [73, 149], [72, 163], [35, 159]], [[527, 146], [552, 146], [552, 155], [527, 155]], [[102, 145], [120, 145], [120, 153], [102, 153]], [[371, 129], [503, 128], [503, 139], [371, 140]], [[99, 126], [193, 126], [193, 139], [99, 139]], [[322, 127], [337, 127], [337, 135], [322, 135]], [[37, 123], [77, 123], [77, 134], [37, 134]], [[324, 106], [337, 106], [337, 115], [324, 115]], [[309, 107], [315, 107], [315, 112], [309, 112]], [[372, 103], [501, 103], [501, 116], [372, 116]], [[349, 105], [360, 105], [360, 114], [349, 114]], [[38, 103], [80, 103], [80, 113], [38, 113]], [[99, 100], [205, 101], [205, 115], [99, 114]], [[306, 90], [317, 90], [317, 97], [306, 97]], [[347, 88], [362, 88], [362, 96], [347, 96]], [[321, 87], [340, 87], [340, 99], [321, 99]], [[358, 84], [513, 82], [513, 95], [358, 97]], [[41, 83], [89, 83], [89, 93], [41, 93]], [[94, 79], [241, 80], [241, 94], [94, 93]], [[313, 66], [394, 66], [394, 79], [313, 79]], [[242, 66], [288, 66], [288, 77], [242, 77]], [[185, 54], [220, 54], [220, 65], [185, 65]], [[469, 48], [547, 48], [547, 61], [469, 61]], [[423, 36], [436, 36], [436, 54], [423, 54]], [[465, 30], [551, 30], [551, 43], [465, 43]], [[207, 21], [329, 23], [328, 41], [207, 39]]]
+00208502.jpg [[[247, 566], [282, 566], [282, 573], [247, 573]], [[558, 534], [629, 539], [627, 570], [556, 565]], [[205, 540], [284, 540], [284, 552], [205, 552]], [[143, 513], [189, 513], [189, 525], [143, 525]], [[249, 512], [307, 512], [307, 524], [249, 524]], [[44, 500], [118, 500], [118, 519], [44, 519]], [[467, 491], [556, 491], [556, 508], [467, 508]], [[667, 490], [678, 494], [675, 503], [664, 499]], [[788, 489], [794, 495], [789, 499], [783, 494]], [[726, 491], [737, 491], [737, 501], [726, 501]], [[42, 452], [117, 450], [117, 469], [42, 470]], [[175, 450], [236, 450], [236, 464], [175, 464]], [[614, 407], [638, 407], [638, 422], [614, 422]], [[95, 405], [119, 405], [119, 422], [95, 422]], [[49, 399], [64, 414], [50, 427], [36, 413]], [[209, 401], [226, 401], [226, 415], [209, 415]], [[40, 357], [58, 357], [58, 374], [40, 374]], [[94, 356], [119, 356], [119, 373], [94, 373]], [[188, 341], [246, 339], [247, 361], [189, 364]], [[459, 321], [549, 319], [549, 337], [460, 339]], [[459, 273], [551, 273], [551, 290], [459, 290]], [[563, 272], [735, 269], [735, 286], [564, 289]], [[517, 225], [547, 225], [547, 245], [517, 245]], [[459, 226], [480, 226], [480, 244], [459, 244]], [[621, 187], [673, 187], [673, 201], [621, 201]], [[457, 132], [548, 130], [548, 147], [458, 149]], [[572, 106], [787, 99], [787, 120], [573, 126]], [[122, 48], [290, 48], [290, 97], [122, 97]], [[539, 39], [708, 39], [708, 89], [539, 89]]]
+00224225.jpg [[[134, 429], [153, 426], [157, 445], [138, 448]], [[202, 404], [478, 411], [476, 459], [201, 452]], [[205, 230], [469, 230], [469, 390], [205, 390]], [[131, 265], [172, 265], [172, 279], [131, 279]], [[345, 207], [456, 207], [456, 231], [345, 231]], [[199, 189], [346, 196], [344, 239], [197, 232]], [[10, 44], [157, 41], [158, 112], [11, 115]]]
+00227746.jpg [[[190, 232], [258, 232], [258, 238], [190, 238]], [[160, 232], [183, 232], [183, 238], [160, 238]], [[123, 232], [150, 232], [150, 238], [123, 238]], [[290, 209], [345, 207], [346, 221], [291, 223]], [[172, 181], [249, 181], [249, 194], [172, 194]], [[143, 178], [165, 180], [162, 208], [140, 206]], [[142, 164], [157, 162], [160, 177], [145, 180]], [[173, 157], [203, 157], [203, 164], [173, 164]], [[200, 154], [347, 154], [347, 167], [200, 167]], [[144, 111], [277, 114], [277, 134], [144, 131]], [[201, 52], [387, 53], [386, 69], [201, 68]], [[139, 47], [191, 45], [192, 62], [140, 64]], [[40, 26], [61, 26], [61, 42], [40, 42]]]
+00229605.jpg [[[743, 529], [881, 529], [881, 544], [743, 544]], [[236, 499], [589, 498], [589, 522], [236, 523]], [[6, 498], [227, 498], [227, 522], [6, 522]], [[736, 496], [883, 499], [883, 520], [735, 517]], [[606, 495], [716, 489], [718, 515], [608, 521]], [[4, 245], [863, 230], [864, 288], [5, 303]], [[478, 28], [883, 28], [883, 76], [478, 76]]]
+00233011.jpg [[[63, 227], [291, 227], [291, 242], [63, 242]], [[12, 219], [41, 219], [41, 250], [12, 250]], [[61, 177], [119, 177], [119, 195], [61, 195]], [[11, 173], [40, 169], [44, 200], [14, 203]], [[61, 129], [147, 131], [147, 147], [61, 144]], [[12, 124], [43, 124], [43, 154], [12, 154]], [[125, 89], [238, 89], [238, 103], [125, 103]], [[148, 51], [216, 51], [216, 65], [148, 65]], [[258, 46], [353, 50], [352, 69], [257, 65]], [[9, 49], [52, 49], [52, 68], [9, 68]], [[277, 12], [345, 12], [345, 31], [277, 31]], [[28, 11], [73, 11], [73, 31], [28, 31]]]
+00233625.jpg [[[375, 397], [632, 399], [632, 443], [375, 440]], [[71, 214], [932, 207], [933, 321], [71, 328]]]
+00233634.jpg [[[215, 639], [261, 639], [261, 703], [215, 703]], [[523, 635], [570, 635], [570, 695], [523, 695]], [[643, 523], [682, 523], [682, 568], [643, 568]], [[97, 516], [152, 516], [152, 589], [97, 589]], [[755, 395], [760, 395], [760, 401], [755, 401]], [[26, 395], [32, 395], [32, 400], [26, 400]], [[678, 364], [728, 362], [731, 430], [681, 432]], [[54, 361], [107, 361], [107, 434], [54, 434]], [[78, 208], [155, 208], [155, 280], [78, 280]], [[643, 205], [693, 205], [693, 272], [643, 272]], [[210, 88], [260, 86], [263, 164], [213, 166]], [[363, 48], [426, 45], [430, 115], [367, 118]]]
+00234400.jpg [[[446, 421], [738, 421], [738, 438], [446, 438]], [[157, 421], [454, 421], [454, 438], [157, 438]], [[158, 394], [652, 394], [652, 411], [158, 411]], [[40, 391], [127, 391], [127, 412], [40, 412]], [[158, 342], [304, 345], [304, 363], [158, 360]], [[38, 344], [123, 344], [123, 362], [38, 362]], [[520, 295], [703, 295], [703, 314], [520, 314]], [[394, 292], [483, 290], [484, 314], [394, 317]], [[157, 293], [270, 293], [270, 313], [157, 313]], [[37, 293], [125, 293], [125, 313], [37, 313]], [[156, 243], [358, 243], [358, 267], [156, 267]], [[36, 243], [82, 243], [82, 269], [36, 269]], [[29, 152], [158, 152], [158, 175], [29, 175]], [[282, 98], [507, 98], [507, 111], [282, 111]], [[315, 46], [475, 50], [474, 88], [314, 85]], [[518, 51], [663, 53], [662, 67], [517, 65]], [[487, 19], [706, 17], [706, 43], [487, 45]]]
+00234883.jpg [[[66, 125], [316, 120], [317, 190], [67, 195]], [[79, 138], [109, 141], [108, 152], [78, 148]], [[72, 120], [120, 120], [120, 130], [72, 130]], [[383, 63], [504, 62], [504, 74], [383, 75]], [[58, 29], [365, 26], [366, 112], [59, 115]], [[387, 28], [501, 26], [501, 45], [387, 47]]]
+test_add_0.jpg [[[311, 521], [391, 521], [391, 534], [311, 534]], [[277, 500], [424, 500], [424, 514], [277, 514]], [[261, 446], [437, 446], [437, 459], [261, 459]], [[212, 428], [485, 428], [485, 441], [212, 441]], [[247, 388], [457, 388], [457, 409], [247, 409]], [[222, 328], [474, 328], [474, 372], [222, 372]], [[208, 207], [492, 211], [490, 277], [207, 272]], [[266, 164], [422, 166], [421, 197], [265, 195]], [[18, 20], [201, 18], [201, 43], [18, 45]]]
+test_add_1.png []
+test_add_10.png [[[157, 124], [186, 124], [186, 172], [157, 172]], [[65, 117], [95, 117], [95, 168], [65, 168]], [[161, 106], [183, 106], [183, 127], [161, 127]], [[69, 100], [94, 100], [94, 128], [69, 128]], [[117, 46], [154, 45], [157, 174], [121, 175]], [[66, 34], [97, 34], [97, 112], [66, 112]]]
+test_add_11.jpg [[[1525, 773], [1564, 756], [1575, 780], [1536, 798]], [[1390, 757], [1483, 757], [1483, 791], [1390, 791]], [[1013, 754], [1207, 754], [1207, 800], [1013, 800]], [[685, 755], [875, 755], [875, 796], [685, 796]], [[356, 753], [566, 747], [567, 793], [358, 798]], [[78, 751], [264, 745], [265, 793], [79, 798]], [[602, 647], [1152, 647], [1152, 703], [602, 703]], [[601, 564], [1148, 555], [1149, 611], [602, 620]], [[598, 480], [1066, 472], [1067, 526], [599, 535]], [[598, 393], [1090, 388], [1090, 439], [599, 444]], [[603, 306], [1057, 306], [1057, 357], [603, 357]], [[357, 184], [1517, 184], [1517, 261], [357, 261]], [[60, 43], [257, 37], [259, 83], [61, 89]], [[1305, 41], [1492, 41], [1492, 87], [1305, 87]], [[973, 40], [1171, 34], [1172, 80], [974, 86]], [[670, 40], [862, 34], [864, 80], [671, 86]], [[363, 34], [558, 34], [558, 85], [363, 85]]]
+test_add_12.jpg [[[11, 592], [136, 594], [135, 613], [11, 611]], [[109, 521], [907, 526], [907, 569], [109, 565]], [[635, 451], [902, 448], [903, 478], [635, 481]], [[112, 447], [466, 449], [466, 486], [112, 483]], [[582, 306], [680, 304], [681, 348], [583, 351]], [[369, 261], [565, 266], [563, 357], [367, 353]], [[64, 85], [853, 88], [853, 161], [64, 159]]]
+test_add_13.jpg [[[68, 94], [117, 97], [116, 114], [67, 111]]]
+test_add_14.jpg [[[30, 97], [235, 95], [236, 127], [31, 129]], [[30, 52], [239, 50], [239, 86], [30, 87]]]
+test_add_15.jpg [[[141, 253], [353, 253], [353, 266], [141, 266]], [[205, 214], [406, 219], [406, 232], [204, 227]], [[106, 212], [193, 213], [193, 227], [106, 226]], [[154, 156], [286, 161], [286, 174], [154, 170]], [[148, 136], [305, 142], [305, 156], [147, 150]], [[108, 137], [145, 137], [145, 148], [108, 148]], [[108, 102], [275, 109], [275, 125], [107, 117]], [[107, 72], [245, 79], [245, 96], [106, 88]], [[107, 39], [209, 42], [209, 62], [106, 59]]]
+test_add_16.jpg [[[398, 842], [408, 842], [408, 852], [398, 852]], [[382, 742], [746, 742], [746, 776], [382, 776]], [[362, 703], [468, 703], [468, 725], [362, 725]], [[1552, 701], [1576, 701], [1576, 746], [1552, 746]], [[1256, 695], [1442, 695], [1442, 721], [1256, 721]], [[1244, 661], [1448, 661], [1448, 687], [1244, 687]], [[386, 645], [668, 645], [668, 679], [386, 679]], [[1226, 625], [1470, 623], [1470, 651], [1226, 653]], [[360, 604], [580, 604], [580, 629], [360, 629]], [[1202, 592], [1494, 592], [1494, 617], [1202, 617]], [[1166, 556], [1530, 556], [1530, 582], [1166, 582]], [[380, 552], [638, 552], [638, 586], [380, 586]], [[356, 502], [516, 502], [516, 536], [356, 536]], [[774, 260], [1124, 260], [1124, 300], [774, 300]], [[374, 210], [504, 210], [504, 300], [374, 300]], [[776, 212], [1088, 217], [1088, 252], [776, 248]]]
+test_add_17.jpg [[[321, 255], [393, 258], [392, 271], [320, 269]], [[307, 222], [411, 228], [411, 241], [306, 236]], [[96, 137], [385, 143], [384, 206], [94, 201]], [[72, 95], [399, 103], [398, 124], [71, 117]], [[68, 76], [224, 79], [223, 93], [67, 90]], [[66, 59], [226, 62], [225, 76], [65, 74]]]
+test_add_18.jpg [[[466, 788], [715, 790], [715, 813], [466, 811]], [[553, 752], [665, 757], [663, 791], [552, 786]], [[119, 539], [189, 539], [189, 570], [119, 570]], [[116, 473], [674, 486], [673, 528], [115, 516]], [[121, 429], [669, 441], [668, 470], [121, 457]], [[122, 376], [673, 383], [673, 409], [122, 402]], [[556, 262], [675, 264], [675, 278], [556, 277]], [[165, 259], [335, 259], [335, 273], [165, 273]], [[344, 195], [456, 197], [455, 220], [343, 217]], [[309, 175], [490, 175], [490, 190], [309, 190]], [[255, 128], [537, 131], [537, 169], [254, 165]], [[347, 92], [486, 94], [486, 109], [346, 107]], [[285, 41], [567, 49], [566, 82], [284, 74]], [[236, 32], [266, 32], [266, 60], [236, 60]]]
+test_add_19.jpg [[[24, 294], [42, 294], [42, 302], [24, 302]], [[64, 293], [105, 293], [105, 303], [64, 303]], [[145, 287], [163, 287], [163, 304], [145, 304]], [[63, 280], [106, 280], [106, 290], [63, 290]], [[9, 281], [26, 281], [26, 288], [9, 288]], [[220, 279], [245, 279], [245, 291], [220, 291]], [[177, 279], [208, 279], [208, 290], [177, 290]], [[23, 279], [51, 279], [51, 290], [23, 290]], [[145, 278], [162, 278], [162, 292], [145, 292]], [[8, 267], [18, 267], [18, 276], [8, 276]], [[221, 265], [243, 265], [243, 277], [221, 277]], [[24, 265], [47, 265], [47, 277], [24, 277]], [[142, 263], [163, 263], [163, 279], [142, 279]], [[218, 252], [249, 252], [249, 265], [218, 265]], [[65, 253], [131, 253], [131, 263], [65, 263]], [[24, 252], [43, 252], [43, 264], [24, 264]], [[8, 253], [18, 253], [18, 262], [8, 262]], [[8, 240], [17, 240], [17, 249], [8, 249]], [[63, 237], [114, 237], [114, 251], [63, 251]], [[25, 236], [47, 239], [45, 251], [23, 249]], [[144, 234], [166, 237], [163, 253], [142, 249]], [[494, 226], [531, 226], [531, 239], [494, 239]], [[335, 226], [354, 226], [354, 237], [335, 237]], [[288, 226], [314, 226], [314, 237], [288, 237]], [[63, 226], [113, 226], [113, 236], [63, 236]], [[7, 227], [17, 227], [17, 234], [7, 234]], [[221, 225], [248, 225], [248, 235], [221, 235]], [[143, 225], [165, 222], [167, 234], [145, 237]], [[24, 224], [48, 224], [48, 238], [24, 238]], [[495, 213], [524, 213], [524, 224], [495, 224]], [[420, 212], [437, 212], [437, 225], [420, 225]], [[336, 212], [398, 212], [398, 223], [336, 223]], [[292, 212], [320, 212], [320, 223], [292, 223]], [[222, 212], [249, 212], [249, 223], [222, 223]], [[145, 212], [166, 212], [166, 223], [145, 223]], [[61, 211], [113, 209], [114, 222], [62, 224]], [[26, 211], [48, 211], [48, 223], [26, 223]], [[337, 199], [383, 199], [383, 209], [337, 209]], [[65, 200], [87, 200], [87, 207], [65, 207]], [[493, 197], [541, 197], [541, 211], [493, 211]], [[445, 202], [455, 196], [462, 206], [452, 212]], [[178, 198], [205, 198], [205, 208], [178, 208]], [[146, 199], [157, 199], [157, 208], [146, 208]], [[32, 194], [43, 204], [33, 214], [22, 203]], [[422, 193], [440, 201], [432, 215], [415, 207]], [[65, 186], [132, 186], [132, 196], [65, 196]], [[337, 185], [399, 185], [399, 196], [337, 196]], [[445, 190], [456, 182], [465, 191], [454, 200]], [[292, 188], [308, 182], [313, 193], [297, 200]], [[220, 183], [255, 183], [255, 197], [220, 197]], [[142, 184], [158, 184], [158, 197], [142, 197]], [[493, 182], [518, 182], [518, 197], [493, 197]], [[425, 180], [437, 191], [427, 202], [414, 190]], [[32, 179], [42, 189], [32, 199], [22, 189]], [[182, 179], [195, 185], [188, 198], [175, 192]], [[335, 172], [400, 169], [400, 183], [336, 185]], [[492, 170], [519, 170], [519, 185], [492, 185]], [[412, 177], [428, 164], [440, 178], [425, 190]], [[293, 171], [315, 171], [315, 185], [293, 185]], [[220, 170], [251, 170], [251, 184], [220, 184]], [[178, 172], [188, 172], [188, 183], [178, 183]], [[64, 172], [125, 170], [125, 181], [64, 182]], [[454, 168], [464, 176], [454, 185], [445, 176]], [[142, 172], [159, 168], [163, 180], [145, 185]], [[30, 165], [43, 174], [34, 186], [20, 177]], [[493, 160], [523, 160], [523, 170], [493, 170]], [[402, 161], [435, 161], [435, 168], [402, 168]], [[335, 159], [401, 159], [401, 169], [335, 169]], [[296, 159], [325, 159], [325, 170], [296, 170]], [[221, 158], [251, 158], [251, 169], [221, 169]], [[174, 161], [183, 156], [190, 167], [181, 172]], [[145, 158], [162, 158], [162, 170], [145, 170]], [[61, 158], [125, 157], [125, 168], [62, 169]], [[20, 161], [33, 154], [40, 167], [28, 174]], [[492, 143], [542, 143], [542, 157], [492, 157]], [[450, 144], [479, 144], [479, 157], [450, 157]], [[335, 143], [439, 143], [439, 156], [335, 156]], [[294, 143], [327, 143], [327, 157], [294, 157]], [[220, 143], [253, 143], [253, 157], [220, 157]], [[178, 145], [187, 145], [187, 156], [178, 156]], [[63, 144], [104, 144], [104, 155], [63, 155]], [[144, 140], [164, 145], [160, 159], [141, 154]], [[31, 137], [44, 149], [31, 162], [17, 149]], [[286, 135], [291, 135], [291, 140], [286, 140]], [[177, 133], [193, 133], [193, 144], [177, 144]], [[336, 132], [388, 132], [388, 141], [336, 141]], [[492, 131], [525, 131], [525, 141], [492, 141]], [[450, 131], [477, 131], [477, 141], [450, 141]], [[292, 131], [321, 131], [321, 141], [292, 141]], [[218, 132], [255, 130], [256, 141], [219, 144]], [[63, 131], [95, 131], [95, 141], [63, 141]], [[417, 130], [437, 130], [437, 141], [417, 141]], [[145, 130], [159, 130], [159, 143], [145, 143]], [[30, 124], [43, 133], [32, 147], [19, 138]], [[493, 118], [535, 118], [535, 129], [493, 129]], [[336, 118], [388, 118], [388, 129], [336, 129]], [[218, 118], [255, 118], [255, 128], [218, 128]], [[451, 117], [478, 117], [478, 129], [451, 129]], [[418, 117], [438, 117], [438, 130], [418, 130]], [[177, 116], [209, 116], [209, 130], [177, 130]], [[145, 117], [162, 117], [162, 130], [145, 130]], [[62, 116], [88, 116], [88, 131], [62, 131]], [[19, 121], [33, 111], [43, 124], [29, 134]], [[491, 107], [523, 107], [523, 113], [491, 113]], [[449, 107], [477, 107], [477, 113], [449, 113]], [[420, 107], [436, 107], [436, 113], [420, 113]], [[295, 107], [319, 107], [319, 114], [295, 114]], [[220, 107], [242, 107], [242, 113], [220, 113]], [[176, 107], [203, 107], [203, 113], [176, 113]], [[145, 107], [161, 107], [161, 114], [145, 114]], [[334, 105], [372, 105], [372, 114], [334, 114]], [[63, 106], [86, 106], [86, 113], [63, 113]], [[483, 89], [522, 89], [522, 99], [483, 99]], [[331, 88], [380, 88], [380, 99], [331, 99]], [[276, 88], [325, 88], [325, 99], [276, 99]], [[214, 88], [246, 88], [246, 99], [214, 99]], [[411, 86], [474, 86], [474, 100], [411, 100]], [[6, 86], [102, 86], [102, 100], [6, 100]], [[415, 66], [461, 66], [461, 77], [415, 77]], [[288, 66], [333, 66], [333, 77], [288, 77]], [[157, 64], [206, 64], [206, 78], [157, 78]], [[416, 48], [523, 49], [523, 63], [415, 62]], [[288, 49], [375, 49], [375, 63], [288, 63]], [[159, 49], [269, 49], [269, 62], [159, 62]], [[24, 53], [36, 46], [45, 59], [33, 67]], [[416, 36], [481, 36], [481, 46], [416, 46]], [[25, 38], [39, 32], [46, 46], [33, 52]], [[157, 34], [205, 34], [205, 47], [157, 47]], [[412, 4], [527, 4], [527, 17], [412, 17]], [[146, 4], [345, 2], [345, 15], [146, 17]]]
+test_add_20.jpg [[[31, 346], [605, 346], [605, 370], [31, 370]], [[217, 294], [510, 294], [510, 322], [217, 322]], [[473, 271], [525, 271], [525, 286], [473, 286]], [[220, 267], [287, 267], [287, 286], [220, 286]], [[219, 239], [484, 239], [484, 263], [219, 263]], [[221, 217], [303, 217], [303, 234], [221, 234]], [[402, 192], [417, 192], [417, 205], [402, 205]], [[222, 187], [341, 187], [341, 207], [222, 207]], [[221, 162], [287, 162], [287, 180], [221, 180]], [[375, 122], [475, 124], [475, 146], [375, 143]], [[222, 124], [356, 122], [356, 143], [222, 146]], [[218, 81], [352, 84], [352, 116], [218, 113]], [[440, 35], [605, 35], [605, 60], [440, 60]], [[72, 16], [398, 16], [398, 44], [72, 44]]]
+test_add_3.jpg [[[169, 327], [337, 326], [337, 341], [169, 342]], [[170, 288], [307, 290], [307, 312], [170, 310]], [[171, 221], [323, 221], [323, 234], [171, 234]], [[340, 221], [449, 217], [449, 231], [341, 234]], [[169, 201], [372, 201], [372, 214], [169, 214]], [[170, 183], [418, 183], [418, 196], [170, 196]], [[170, 149], [416, 149], [416, 163], [170, 163]], [[171, 119], [418, 119], [418, 140], [171, 140]], [[326, 64], [478, 64], [478, 91], [326, 91]], [[173, 64], [306, 60], [306, 89], [174, 93]]]
+test_add_4.png []
+test_add_5.png [[[48, 164], [108, 164], [108, 174], [48, 174]], [[52, 121], [169, 121], [169, 134], [52, 134]], [[50, 102], [165, 102], [165, 118], [50, 118]], [[52, 83], [164, 83], [164, 100], [52, 100]], [[51, 68], [166, 68], [166, 84], [51, 84]], [[51, 50], [145, 47], [145, 64], [52, 67]]]
+test_add_6.jpg [[[123, 223], [219, 227], [218, 251], [122, 247]], [[172, 172], [186, 186], [172, 200], [158, 186]]]
+test_add_7.jpg [[[48, 938], [174, 936], [174, 962], [48, 964]], [[227, 873], [629, 876], [628, 953], [226, 949]], [[56, 745], [638, 745], [638, 790], [56, 790]], [[150, 674], [545, 678], [544, 721], [150, 718]], [[73, 504], [633, 504], [633, 601], [73, 601]], [[59, 270], [655, 279], [652, 441], [56, 432]], [[513, 193], [553, 193], [553, 223], [513, 223]], [[61, 175], [532, 175], [532, 239], [61, 239]], [[533, 178], [642, 178], [642, 236], [533, 236]]]
+test_add_8.jpg [[[251, 586], [454, 580], [454, 606], [252, 613]], [[107, 533], [457, 527], [457, 560], [108, 566]], [[336, 494], [384, 494], [384, 507], [336, 507]], [[27, 307], [355, 297], [356, 320], [28, 330]], [[22, 259], [445, 251], [445, 274], [23, 282]], [[78, 209], [445, 205], [445, 225], [78, 229]], [[160, 23], [319, 30], [317, 79], [158, 72]]]
+test_add_9.png [[[266, 687], [486, 687], [486, 696], [266, 696]], [[196, 668], [554, 668], [554, 681], [196, 681]], [[154, 596], [597, 596], [597, 606], [154, 606]], [[215, 578], [541, 578], [541, 588], [215, 588]], [[85, 543], [665, 543], [665, 553], [85, 553]], [[96, 522], [653, 522], [653, 535], [96, 535]], [[362, 449], [389, 449], [389, 460], [362, 460]], [[238, 376], [513, 376], [513, 389], [238, 389]], [[177, 356], [574, 356], [574, 368], [177, 368]], [[344, 281], [408, 283], [407, 297], [343, 294]], [[257, 205], [493, 205], [493, 219], [257, 219]]]
diff --git a/tests/results/det_results_gpu_trt_fp16.txt b/tests/results/det_results_gpu_trt_fp16.txt
new file mode 100644
index 0000000000000000000000000000000000000000..191bdaf7807dad9129eb965f4ac81dadc9572af6
--- /dev/null
+++ b/tests/results/det_results_gpu_trt_fp16.txt
@@ -0,0 +1,49 @@
+00008790.jpg [[[209, 406], [280, 406], [280, 419], [209, 419]], [[60, 398], [105, 398], [105, 411], [60, 411]], [[198, 389], [291, 389], [291, 402], [198, 402]], [[162, 391], [173, 391], [173, 401], [162, 401]], [[35, 380], [133, 380], [133, 393], [35, 393]], [[199, 371], [292, 371], [292, 384], [199, 384]], [[218, 310], [272, 310], [272, 324], [218, 324]], [[162, 305], [172, 305], [172, 314], [162, 314]], [[371, 302], [436, 302], [436, 316], [371, 316]], [[31, 302], [134, 301], [134, 315], [31, 316]], [[223, 292], [269, 292], [269, 306], [223, 306]], [[60, 225], [104, 225], [104, 236], [60, 236]], [[218, 223], [272, 223], [272, 237], [218, 237]], [[162, 219], [173, 219], [173, 227], [162, 227]], [[33, 207], [131, 207], [131, 220], [33, 220]], [[223, 206], [269, 206], [269, 220], [223, 220]], [[74, 146], [383, 146], [383, 159], [74, 159]], [[54, 120], [117, 120], [117, 134], [54, 134]], [[74, 51], [296, 51], [296, 65], [74, 65]], [[56, 18], [116, 18], [116, 32], [56, 32]]]
+00018946.jpg [[[441, 328], [474, 328], [474, 339], [441, 339]], [[86, 284], [141, 286], [140, 307], [85, 305]], [[302, 279], [377, 279], [377, 297], [302, 297]], [[197, 265], [281, 274], [279, 293], [195, 284]], [[198, 197], [452, 219], [450, 242], [196, 220]], [[343, 182], [376, 182], [376, 192], [343, 192]], [[199, 164], [340, 171], [339, 192], [198, 185]], [[177, 101], [415, 118], [413, 145], [175, 128]]]
+00034387.jpg [[[265, 460], [740, 460], [740, 484], [265, 484]], [[348, 417], [420, 417], [420, 443], [348, 443]], [[545, 418], [568, 418], [568, 442], [545, 442]], [[685, 417], [710, 417], [710, 443], [685, 443]], [[175, 415], [226, 415], [226, 443], [175, 443]], [[874, 414], [908, 414], [908, 446], [874, 446]], [[56, 417], [74, 417], [74, 442], [56, 442]], [[856, 373], [925, 373], [925, 400], [856, 400]], [[348, 372], [418, 372], [418, 397], [348, 397]], [[674, 372], [723, 372], [723, 401], [674, 401]], [[539, 373], [570, 373], [570, 400], [539, 400]], [[151, 365], [228, 369], [226, 402], [149, 398]], [[56, 372], [74, 372], [74, 397], [56, 397]], [[857, 329], [925, 329], [925, 355], [857, 355]], [[351, 330], [419, 330], [419, 356], [351, 356]], [[674, 328], [723, 328], [723, 356], [674, 356]], [[541, 329], [570, 329], [570, 357], [541, 357]], [[171, 327], [227, 324], [229, 355], [173, 358]], [[57, 330], [74, 330], [74, 356], [57, 356]], [[298, 327], [316, 327], [316, 334], [298, 334]], [[855, 286], [925, 286], [925, 312], [855, 312]], [[674, 286], [723, 286], [723, 313], [674, 313]], [[346, 286], [426, 283], [427, 313], [347, 316]], [[540, 285], [569, 285], [569, 312], [540, 312]], [[172, 282], [226, 282], [226, 313], [172, 313]], [[56, 287], [73, 287], [73, 312], [56, 312]], [[857, 242], [925, 242], [925, 268], [857, 268]], [[348, 242], [460, 242], [460, 268], [348, 268]], [[156, 242], [227, 242], [227, 269], [156, 269]], [[674, 241], [724, 241], [724, 269], [674, 269]], [[531, 241], [572, 241], [572, 270], [531, 270]], [[56, 242], [74, 242], [74, 268], [56, 268]], [[855, 197], [925, 200], [924, 226], [854, 224]], [[674, 198], [726, 198], [726, 226], [674, 226]], [[344, 200], [430, 195], [432, 224], [346, 230]], [[176, 197], [227, 197], [227, 225], [176, 225]], [[56, 200], [73, 200], [73, 226], [56, 226]], [[527, 194], [576, 194], [576, 226], [527, 226]], [[349, 155], [419, 155], [419, 181], [349, 181]], [[854, 154], [925, 154], [925, 180], [854, 180]], [[176, 154], [226, 154], [226, 183], [176, 183]], [[670, 153], [723, 153], [723, 181], [670, 181]], [[538, 154], [571, 154], [571, 182], [538, 182]], [[56, 156], [74, 156], [74, 182], [56, 182]], [[349, 111], [419, 111], [419, 137], [349, 137]], [[174, 111], [227, 111], [227, 139], [174, 139]], [[546, 113], [564, 113], [564, 137], [546, 137]], [[52, 112], [75, 112], [75, 139], [52, 139]], [[639, 108], [727, 105], [728, 138], [640, 141]], [[817, 103], [927, 110], [925, 139], [815, 132]], [[814, 68], [951, 68], [951, 92], [814, 92]], [[307, 66], [446, 68], [446, 93], [306, 90]], [[673, 67], [723, 67], [723, 93], [673, 93]], [[175, 65], [228, 68], [226, 95], [174, 92]], [[39, 65], [90, 68], [88, 97], [37, 94]], [[528, 65], [580, 65], [580, 94], [528, 94]], [[334, 20], [670, 20], [670, 43], [334, 43]]]
+00037951.jpg [[[434, 976], [551, 978], [550, 993], [434, 991]], [[433, 932], [553, 932], [553, 969], [433, 969]], [[30, 522], [98, 522], [98, 545], [30, 545]], [[31, 443], [145, 443], [145, 464], [31, 464]], [[234, 335], [326, 332], [327, 354], [235, 356]], [[124, 252], [436, 252], [436, 284], [124, 284]], [[182, 206], [378, 206], [378, 227], [182, 227]], [[258, 106], [320, 123], [304, 181], [242, 163]], [[28, 65], [33, 65], [33, 71], [28, 71]], [[37, 58], [147, 58], [147, 80], [37, 80]]]
+00044782.jpg [[[104, 218], [115, 218], [115, 227], [104, 227]], [[223, 216], [246, 216], [246, 228], [223, 228]], [[163, 216], [182, 216], [182, 229], [163, 229]], [[124, 191], [164, 191], [164, 202], [124, 202]], [[91, 84], [251, 84], [251, 98], [91, 98]], [[73, 63], [278, 63], [278, 78], [73, 78]], [[104, 15], [243, 15], [243, 44], [104, 44]]]
+00067516.jpg [[[141, 808], [594, 809], [594, 822], [141, 821]], [[49, 784], [696, 784], [696, 798], [49, 798]], [[579, 751], [667, 751], [667, 764], [579, 764]], [[355, 750], [395, 750], [395, 767], [355, 767]], [[221, 751], [260, 751], [260, 765], [221, 765]], [[477, 750], [501, 750], [501, 768], [477, 768]], [[69, 748], [133, 751], [132, 765], [68, 761]], [[576, 682], [668, 682], [668, 699], [576, 699]], [[476, 682], [518, 682], [518, 700], [476, 700]], [[354, 682], [395, 682], [395, 700], [354, 700]], [[69, 681], [133, 684], [132, 699], [68, 695]], [[220, 679], [243, 682], [241, 700], [218, 697]], [[577, 615], [667, 615], [667, 632], [577, 632]], [[68, 612], [134, 615], [133, 632], [67, 629]], [[476, 614], [500, 614], [500, 633], [476, 633]], [[354, 613], [378, 613], [378, 634], [354, 634]], [[219, 612], [245, 612], [245, 633], [219, 633]], [[578, 547], [667, 547], [667, 564], [578, 564]], [[476, 546], [518, 546], [518, 565], [476, 565]], [[353, 545], [379, 545], [379, 566], [353, 566]], [[219, 545], [245, 545], [245, 566], [219, 566]], [[68, 542], [133, 546], [132, 563], [67, 560]], [[68, 478], [133, 482], [132, 499], [67, 496]], [[586, 481], [664, 481], [664, 497], [586, 497]], [[476, 480], [518, 480], [518, 498], [476, 498]], [[354, 480], [395, 480], [395, 498], [354, 498]], [[219, 479], [245, 479], [245, 500], [219, 500]], [[580, 425], [665, 429], [664, 449], [580, 446]], [[346, 429], [410, 429], [410, 447], [346, 447]], [[68, 426], [150, 429], [149, 449], [67, 447]], [[474, 427], [515, 427], [515, 449], [474, 449]], [[218, 427], [259, 427], [259, 449], [218, 449]], [[283, 398], [478, 399], [478, 419], [283, 418]], [[86, 318], [664, 318], [664, 332], [86, 332]], [[65, 279], [665, 279], [665, 292], [65, 292]], [[458, 210], [584, 210], [584, 224], [458, 224]], [[313, 209], [372, 209], [372, 226], [313, 226]], [[164, 209], [225, 209], [225, 226], [164, 226]], [[505, 151], [539, 151], [539, 166], [505, 166]], [[266, 48], [483, 48], [483, 68], [266, 68]]]
+00088568.jpg [[[341, 446], [371, 446], [371, 453], [341, 453]], [[58, 445], [117, 445], [117, 455], [58, 455]], [[552, 433], [571, 433], [571, 440], [552, 440]], [[583, 431], [740, 431], [740, 442], [583, 442]], [[311, 415], [743, 415], [743, 428], [311, 428]], [[311, 377], [736, 377], [736, 390], [311, 390]], [[425, 340], [551, 340], [551, 350], [425, 350]], [[287, 324], [294, 332], [289, 337], [281, 330]], [[276, 294], [348, 296], [347, 311], [276, 309]], [[54, 288], [210, 288], [210, 301], [54, 301]], [[275, 265], [421, 265], [421, 278], [275, 278]], [[56, 264], [248, 264], [248, 277], [56, 277]], [[671, 248], [695, 248], [695, 261], [671, 261]], [[602, 248], [628, 248], [628, 261], [602, 261]], [[533, 248], [557, 248], [557, 261], [533, 261]], [[463, 248], [487, 248], [487, 261], [463, 261]], [[278, 248], [309, 248], [309, 260], [278, 260]], [[55, 240], [142, 240], [142, 254], [55, 254]], [[277, 231], [398, 231], [398, 244], [277, 244]], [[741, 228], [749, 237], [742, 245], [733, 236]], [[665, 230], [700, 230], [700, 244], [665, 244]], [[598, 230], [631, 230], [631, 244], [598, 244]], [[528, 230], [562, 230], [562, 244], [528, 244]], [[459, 230], [492, 230], [492, 244], [459, 244]], [[54, 215], [211, 217], [211, 231], [54, 229]], [[739, 211], [749, 221], [740, 229], [731, 220]], [[663, 214], [704, 214], [704, 228], [663, 228]], [[595, 215], [637, 215], [637, 226], [595, 226]], [[524, 215], [568, 215], [568, 226], [524, 226]], [[454, 215], [495, 215], [495, 226], [454, 226]], [[279, 215], [351, 215], [351, 226], [279, 226]], [[736, 199], [747, 199], [747, 208], [736, 208]], [[668, 197], [700, 197], [700, 208], [668, 208]], [[599, 196], [633, 196], [633, 210], [599, 210]], [[529, 197], [562, 197], [562, 208], [529, 208]], [[461, 197], [491, 197], [491, 208], [461, 208]], [[277, 195], [417, 196], [417, 211], [277, 209]], [[55, 192], [239, 192], [239, 205], [55, 205]], [[665, 181], [703, 181], [703, 192], [665, 192]], [[279, 180], [351, 181], [350, 192], [279, 191]], [[734, 180], [747, 180], [747, 193], [734, 193]], [[597, 180], [634, 180], [634, 191], [597, 191]], [[525, 179], [566, 179], [566, 193], [525, 193]], [[458, 180], [493, 180], [493, 191], [458, 191]], [[55, 170], [142, 170], [142, 184], [55, 184]], [[735, 165], [747, 165], [747, 175], [735, 175]], [[665, 163], [703, 163], [703, 175], [665, 175]], [[598, 163], [634, 163], [634, 175], [598, 175]], [[527, 163], [565, 163], [565, 175], [527, 175]], [[458, 163], [492, 163], [492, 175], [458, 175]], [[279, 162], [398, 162], [398, 176], [279, 176]], [[54, 146], [148, 146], [148, 159], [54, 159]], [[453, 147], [495, 147], [495, 158], [453, 158]], [[731, 143], [748, 146], [745, 161], [728, 158]], [[663, 145], [704, 145], [704, 159], [663, 159]], [[596, 146], [635, 146], [635, 157], [596, 157]], [[522, 145], [566, 142], [567, 157], [523, 159]], [[277, 144], [310, 144], [310, 158], [277, 158]], [[276, 121], [428, 121], [428, 139], [276, 139]], [[52, 120], [232, 121], [232, 139], [52, 138]], [[404, 91], [701, 91], [701, 106], [404, 106]], [[48, 79], [280, 79], [280, 97], [48, 97]], [[325, 69], [744, 70], [744, 84], [325, 83]], [[668, 48], [743, 48], [743, 63], [668, 63]], [[297, 48], [433, 48], [433, 62], [297, 62]]]
+00091741.jpg [[[47, 336], [83, 336], [83, 358], [47, 358]], [[98, 211], [257, 209], [257, 229], [98, 231]], [[103, 190], [257, 191], [257, 205], [103, 204]], [[89, 101], [266, 99], [267, 181], [90, 184]], [[94, 48], [262, 55], [260, 114], [91, 107]], [[91, 12], [257, 14], [257, 37], [90, 35]]]
+00105313.jpg [[[291, 262], [406, 262], [406, 275], [291, 275]], [[153, 262], [264, 262], [264, 274], [153, 274]], [[11, 258], [73, 261], [72, 274], [11, 272]], [[33, 231], [132, 231], [132, 244], [33, 244]], [[35, 217], [216, 217], [216, 227], [35, 227]], [[33, 200], [146, 200], [146, 213], [33, 213]], [[32, 183], [215, 184], [215, 197], [32, 196]], [[35, 170], [105, 170], [105, 181], [35, 181]], [[35, 155], [124, 155], [124, 164], [35, 164]], [[34, 137], [142, 138], [142, 149], [34, 148]], [[35, 123], [176, 123], [176, 133], [35, 133]], [[33, 106], [176, 106], [176, 119], [33, 119]], [[34, 92], [102, 92], [102, 102], [34, 102]], [[34, 77], [119, 77], [119, 87], [34, 87]], [[32, 60], [120, 60], [120, 73], [32, 73]], [[35, 46], [119, 46], [119, 55], [35, 55]], [[32, 29], [142, 29], [142, 42], [32, 42]], [[25, 12], [147, 12], [147, 24], [25, 24]]]
+00134770.jpg [[[388, 646], [456, 646], [456, 656], [388, 656]], [[407, 620], [484, 619], [485, 633], [408, 634]], [[112, 534], [270, 531], [270, 549], [113, 551]], [[111, 502], [443, 497], [443, 514], [112, 519]], [[111, 471], [443, 467], [443, 484], [112, 488]], [[111, 439], [444, 434], [444, 451], [112, 457]], [[111, 409], [442, 405], [442, 421], [112, 425]], [[153, 376], [441, 373], [441, 390], [153, 394]], [[184, 338], [369, 336], [369, 356], [185, 358]], [[75, 98], [515, 104], [513, 218], [74, 212]]]
+00145943.jpg [[[394, 248], [746, 279], [731, 449], [379, 418]], [[90, 92], [300, 92], [300, 119], [90, 119]], [[46, 41], [326, 39], [326, 75], [46, 77]]]
+00147605.jpg [[[805, 616], [874, 616], [874, 627], [805, 627]], [[516, 607], [784, 605], [784, 628], [516, 629]], [[118, 522], [224, 522], [224, 560], [118, 560]], [[253, 524], [307, 524], [307, 557], [253, 557]], [[715, 501], [900, 505], [900, 538], [714, 534]], [[255, 502], [295, 502], [295, 517], [255, 517]], [[347, 481], [473, 481], [473, 515], [347, 515]], [[252, 484], [295, 484], [295, 499], [252, 499]], [[350, 456], [447, 456], [447, 470], [350, 470]], [[145, 444], [201, 444], [201, 467], [145, 467]], [[728, 371], [878, 371], [878, 420], [728, 420]], [[528, 369], [681, 369], [681, 418], [528, 418]], [[143, 369], [488, 369], [488, 420], [143, 420]], [[744, 315], [871, 315], [871, 336], [744, 336]], [[799, 157], [886, 154], [887, 188], [800, 191]], [[274, 142], [455, 142], [455, 160], [274, 160]], [[738, 116], [894, 119], [893, 157], [737, 153]], [[108, 112], [204, 112], [204, 130], [108, 130]], [[270, 92], [463, 96], [462, 132], [270, 129]]]
+00150341.jpg [[[100, 644], [297, 644], [297, 661], [100, 661]], [[115, 617], [288, 617], [288, 631], [115, 631]], [[84, 593], [319, 592], [319, 609], [84, 610]], [[31, 565], [313, 562], [314, 580], [31, 582]], [[444, 560], [461, 560], [461, 569], [444, 569]], [[390, 557], [446, 557], [446, 572], [390, 572]], [[31, 515], [168, 515], [168, 529], [31, 529]], [[33, 490], [110, 490], [110, 504], [33, 504]], [[358, 459], [464, 463], [463, 485], [357, 481]], [[28, 459], [268, 460], [268, 481], [28, 480]], [[339, 439], [421, 444], [421, 460], [338, 455]], [[65, 439], [143, 439], [143, 453], [65, 453]], [[207, 416], [292, 416], [292, 434], [207, 434]], [[319, 408], [441, 413], [440, 438], [318, 433]], [[44, 405], [175, 409], [174, 434], [43, 430]], [[31, 383], [137, 383], [137, 404], [31, 404]]]
+00150669.jpg [[[649, 700], [681, 700], [681, 716], [649, 716]], [[517, 685], [549, 685], [549, 720], [517, 720]], [[651, 688], [678, 688], [678, 701], [651, 701]], [[862, 687], [876, 687], [876, 695], [862, 695]], [[922, 675], [938, 675], [938, 685], [922, 685]], [[785, 671], [807, 671], [807, 687], [785, 687]], [[592, 672], [606, 672], [606, 686], [592, 686]], [[722, 679], [732, 669], [742, 678], [731, 688]], [[651, 680], [667, 665], [681, 679], [666, 695]], [[273, 667], [422, 667], [422, 688], [273, 688]], [[47, 668], [108, 668], [108, 686], [47, 686]], [[136, 666], [203, 666], [203, 688], [136, 688]], [[782, 629], [810, 629], [810, 661], [782, 661]], [[645, 627], [685, 627], [685, 665], [645, 665]], [[516, 628], [548, 628], [548, 664], [516, 664]], [[655, 619], [672, 619], [672, 627], [655, 627]], [[598, 617], [605, 624], [599, 629], [592, 622]], [[523, 619], [540, 619], [540, 627], [523, 627]], [[858, 618], [868, 618], [868, 627], [858, 627]], [[727, 618], [735, 618], [735, 627], [727, 627]], [[919, 620], [932, 611], [942, 624], [929, 633]], [[786, 616], [805, 616], [805, 629], [786, 629]], [[373, 604], [420, 604], [420, 619], [373, 619]], [[85, 603], [215, 605], [214, 621], [84, 619]], [[48, 603], [71, 603], [71, 622], [48, 622]], [[788, 561], [806, 561], [806, 572], [788, 572]], [[923, 560], [935, 560], [935, 574], [923, 574]], [[856, 560], [869, 560], [869, 574], [856, 574]], [[62, 554], [410, 554], [410, 568], [62, 568]], [[63, 532], [116, 535], [115, 545], [62, 543]], [[859, 527], [868, 527], [868, 539], [859, 539]], [[925, 526], [934, 526], [934, 540], [925, 540]], [[794, 520], [807, 529], [798, 542], [785, 533]], [[526, 526], [535, 526], [535, 536], [526, 536]], [[262, 513], [395, 513], [395, 526], [262, 526]], [[122, 514], [245, 514], [245, 524], [122, 524]], [[49, 514], [119, 514], [119, 525], [49, 525]], [[755, 492], [828, 492], [828, 507], [755, 507]], [[638, 492], [710, 492], [710, 507], [638, 507]], [[519, 492], [592, 492], [592, 507], [519, 507]], [[85, 450], [123, 450], [123, 461], [85, 461]], [[220, 450], [236, 447], [238, 459], [223, 462]], [[683, 445], [868, 445], [868, 459], [683, 459]], [[562, 445], [666, 445], [666, 459], [562, 459]], [[491, 446], [544, 446], [544, 458], [491, 458]], [[183, 437], [208, 437], [208, 459], [183, 459]], [[52, 431], [72, 438], [64, 462], [44, 455]], [[224, 432], [276, 432], [276, 443], [224, 443]], [[88, 432], [144, 432], [144, 443], [88, 443]], [[506, 383], [616, 382], [616, 397], [506, 398]], [[702, 381], [758, 381], [758, 399], [702, 399]], [[308, 373], [364, 373], [364, 384], [308, 384]], [[92, 373], [167, 373], [167, 384], [92, 384]], [[688, 335], [820, 335], [820, 350], [688, 350]], [[498, 335], [657, 335], [657, 350], [498, 350]], [[208, 316], [244, 316], [244, 331], [208, 331]], [[499, 289], [641, 289], [641, 302], [499, 302]], [[671, 287], [801, 287], [801, 301], [671, 301]], [[670, 241], [816, 241], [816, 255], [670, 255]], [[497, 241], [643, 241], [643, 255], [497, 255]], [[670, 194], [815, 194], [815, 208], [670, 208]], [[498, 194], [643, 194], [643, 208], [498, 208]], [[670, 145], [815, 145], [815, 160], [670, 160]], [[499, 145], [645, 145], [645, 160], [499, 160]], [[489, 103], [546, 103], [546, 120], [489, 120]], [[56, 89], [95, 89], [95, 97], [56, 97]], [[845, 26], [887, 20], [889, 39], [848, 44]], [[26, 20], [700, 20], [700, 37], [26, 37]], [[898, 11], [996, 16], [995, 45], [896, 40]]]
+00152568.jpg [[[3, 252], [284, 254], [284, 280], [3, 278]], [[196, 233], [254, 233], [254, 240], [196, 240]], [[49, 229], [90, 229], [90, 240], [49, 240]], [[200, 159], [281, 165], [276, 229], [195, 222]]]
+00155628.jpg [[[149, 901], [503, 903], [503, 922], [149, 920]], [[520, 893], [561, 896], [560, 911], [519, 908]], [[61, 885], [81, 885], [81, 894], [61, 894]], [[150, 878], [503, 882], [503, 900], [149, 896]], [[524, 834], [640, 839], [639, 856], [524, 852]], [[70, 834], [185, 835], [185, 853], [69, 852]], [[246, 555], [466, 555], [466, 569], [246, 569]], [[308, 507], [403, 509], [403, 524], [308, 522]], [[244, 482], [459, 484], [459, 502], [244, 500]], [[252, 422], [459, 424], [458, 452], [251, 450]], [[195, 378], [517, 380], [516, 408], [195, 406]], [[474, 194], [624, 196], [624, 210], [473, 208]], [[73, 129], [641, 131], [641, 160], [73, 158]], [[483, 41], [597, 37], [599, 98], [486, 102]], [[68, 25], [135, 16], [139, 43], [72, 52]]]
+00173364.jpg [[[8, 178], [56, 178], [56, 200], [8, 200]], [[137, 120], [194, 120], [194, 133], [137, 133]], [[39, 76], [86, 76], [86, 105], [39, 105]], [[249, 20], [310, 20], [310, 36], [249, 36]], [[21, 16], [104, 16], [104, 39], [21, 39]]]
+00175503.jpg [[[43, 260], [500, 255], [501, 358], [44, 363]], [[52, 200], [349, 178], [354, 251], [58, 273]]]
+00193218.jpg [[[283, 375], [410, 375], [410, 388], [283, 388]], [[172, 375], [221, 375], [221, 389], [172, 389]], [[110, 375], [161, 375], [161, 389], [110, 389]], [[276, 358], [357, 358], [357, 371], [276, 371]], [[171, 359], [220, 359], [220, 370], [171, 370]], [[409, 357], [492, 357], [492, 370], [409, 370]], [[26, 187], [62, 187], [62, 202], [26, 202]], [[501, 185], [557, 185], [557, 199], [501, 199]], [[381, 187], [420, 185], [421, 199], [382, 201]], [[284, 186], [310, 186], [310, 201], [284, 201]], [[174, 186], [196, 186], [196, 201], [174, 201]], [[499, 165], [540, 165], [540, 176], [499, 176]], [[381, 164], [409, 164], [409, 177], [381, 177]], [[262, 163], [302, 163], [302, 177], [262, 177]], [[176, 163], [230, 163], [230, 177], [176, 177]], [[26, 163], [79, 163], [79, 177], [26, 177]], [[387, 140], [488, 140], [488, 153], [387, 153]], [[28, 139], [131, 139], [131, 152], [28, 152]], [[443, 117], [537, 119], [537, 133], [443, 132]], [[346, 119], [405, 119], [405, 130], [346, 130]], [[261, 119], [303, 119], [303, 130], [261, 130]], [[30, 113], [228, 116], [228, 131], [30, 129]], [[131, 91], [394, 94], [394, 109], [131, 105]], [[562, 82], [583, 82], [583, 107], [562, 107]]]
+00195033.jpg [[[488, 263], [533, 265], [532, 280], [487, 278]], [[126, 250], [192, 250], [192, 283], [126, 283]], [[338, 249], [362, 249], [362, 266], [338, 266]], [[319, 222], [380, 225], [380, 238], [319, 236]], [[431, 224], [450, 224], [450, 235], [431, 235]], [[365, 203], [538, 203], [538, 216], [365, 216]], [[89, 200], [146, 203], [146, 217], [89, 214]], [[329, 201], [354, 201], [354, 212], [329, 212]], [[371, 181], [449, 181], [449, 194], [371, 194]], [[329, 181], [352, 181], [352, 192], [329, 192]], [[96, 179], [240, 179], [240, 193], [96, 193]], [[456, 162], [555, 162], [555, 175], [456, 175]], [[129, 150], [287, 151], [287, 165], [129, 164]], [[36, 145], [73, 149], [72, 163], [35, 159]], [[527, 146], [552, 146], [552, 155], [527, 155]], [[102, 145], [120, 145], [120, 153], [102, 153]], [[371, 129], [503, 128], [503, 139], [371, 140]], [[99, 126], [193, 126], [193, 139], [99, 139]], [[322, 127], [337, 127], [337, 135], [322, 135]], [[37, 123], [77, 123], [77, 134], [37, 134]], [[324, 106], [337, 106], [337, 115], [324, 115]], [[309, 107], [315, 107], [315, 112], [309, 112]], [[372, 103], [501, 103], [501, 116], [372, 116]], [[349, 105], [360, 105], [360, 114], [349, 114]], [[38, 103], [80, 103], [80, 113], [38, 113]], [[99, 100], [205, 101], [205, 115], [99, 114]], [[306, 90], [317, 90], [317, 97], [306, 97]], [[347, 88], [362, 88], [362, 96], [347, 96]], [[321, 87], [340, 87], [340, 99], [321, 99]], [[358, 84], [513, 82], [513, 95], [358, 97]], [[41, 83], [89, 83], [89, 93], [41, 93]], [[94, 79], [241, 80], [241, 94], [94, 93]], [[313, 66], [394, 66], [394, 79], [313, 79]], [[242, 66], [288, 66], [288, 77], [242, 77]], [[185, 54], [220, 54], [220, 65], [185, 65]], [[469, 48], [547, 48], [547, 61], [469, 61]], [[423, 36], [436, 36], [436, 54], [423, 54]], [[465, 30], [551, 30], [551, 43], [465, 43]], [[207, 21], [329, 23], [328, 41], [207, 39]]]
+00208502.jpg [[[247, 566], [282, 566], [282, 573], [247, 573]], [[558, 534], [629, 539], [627, 570], [556, 565]], [[205, 540], [284, 540], [284, 552], [205, 552]], [[143, 513], [189, 513], [189, 525], [143, 525]], [[249, 512], [307, 512], [307, 524], [249, 524]], [[44, 500], [118, 500], [118, 519], [44, 519]], [[467, 491], [556, 491], [556, 508], [467, 508]], [[667, 490], [678, 494], [675, 503], [664, 499]], [[788, 489], [794, 495], [789, 499], [783, 494]], [[726, 491], [737, 491], [737, 501], [726, 501]], [[42, 452], [117, 450], [117, 469], [42, 470]], [[175, 450], [236, 450], [236, 464], [175, 464]], [[614, 407], [638, 407], [638, 422], [614, 422]], [[95, 405], [119, 405], [119, 422], [95, 422]], [[49, 399], [64, 414], [50, 427], [36, 413]], [[209, 401], [226, 401], [226, 415], [209, 415]], [[40, 357], [58, 357], [58, 374], [40, 374]], [[94, 356], [119, 356], [119, 373], [94, 373]], [[188, 341], [246, 339], [247, 361], [189, 364]], [[459, 321], [549, 319], [549, 337], [460, 339]], [[459, 273], [551, 273], [551, 290], [459, 290]], [[563, 272], [735, 269], [735, 286], [564, 289]], [[517, 225], [547, 225], [547, 245], [517, 245]], [[459, 226], [480, 226], [480, 244], [459, 244]], [[621, 187], [673, 187], [673, 201], [621, 201]], [[457, 132], [548, 130], [548, 147], [458, 149]], [[572, 106], [787, 99], [787, 120], [573, 126]], [[122, 48], [290, 48], [290, 97], [122, 97]], [[539, 39], [708, 39], [708, 89], [539, 89]]]
+00224225.jpg [[[134, 429], [153, 426], [157, 445], [138, 448]], [[202, 404], [478, 411], [476, 459], [201, 452]], [[205, 230], [469, 230], [469, 390], [205, 390]], [[131, 265], [172, 265], [172, 279], [131, 279]], [[345, 207], [456, 207], [456, 231], [345, 231]], [[199, 189], [346, 196], [344, 239], [197, 232]], [[10, 44], [157, 41], [158, 112], [11, 115]]]
+00227746.jpg [[[190, 232], [258, 232], [258, 238], [190, 238]], [[160, 232], [183, 232], [183, 238], [160, 238]], [[123, 232], [150, 232], [150, 238], [123, 238]], [[290, 208], [345, 206], [346, 222], [291, 224]], [[172, 181], [249, 181], [249, 194], [172, 194]], [[143, 178], [165, 180], [162, 208], [140, 206]], [[142, 164], [157, 162], [160, 177], [145, 180]], [[173, 157], [203, 157], [203, 164], [173, 164]], [[200, 154], [347, 154], [347, 167], [200, 167]], [[144, 111], [277, 114], [277, 134], [144, 131]], [[201, 52], [387, 53], [386, 69], [201, 68]], [[141, 46], [192, 46], [192, 63], [141, 63]], [[40, 26], [61, 26], [61, 42], [40, 42]]]
+00229605.jpg [[[743, 529], [881, 529], [881, 544], [743, 544]], [[236, 499], [589, 498], [589, 522], [236, 523]], [[6, 498], [227, 498], [227, 522], [6, 522]], [[735, 496], [883, 499], [883, 520], [734, 517]], [[606, 495], [716, 489], [718, 515], [608, 521]], [[4, 245], [863, 230], [864, 288], [5, 303]], [[478, 28], [883, 28], [883, 76], [478, 76]]]
+00233011.jpg [[[63, 227], [291, 227], [291, 242], [63, 242]], [[12, 219], [41, 219], [41, 250], [12, 250]], [[61, 177], [119, 177], [119, 195], [61, 195]], [[11, 173], [40, 169], [44, 200], [14, 203]], [[61, 129], [147, 131], [147, 147], [61, 144]], [[12, 124], [43, 124], [43, 154], [12, 154]], [[125, 89], [238, 89], [238, 103], [125, 103]], [[148, 51], [216, 51], [216, 65], [148, 65]], [[258, 46], [353, 50], [352, 69], [257, 65]], [[9, 49], [52, 49], [52, 68], [9, 68]], [[277, 12], [345, 12], [345, 31], [277, 31]], [[28, 11], [74, 11], [74, 31], [28, 31]]]
+00233625.jpg [[[375, 397], [632, 399], [632, 443], [375, 440]], [[71, 214], [932, 207], [933, 321], [71, 328]]]
+00233634.jpg [[[215, 639], [261, 639], [261, 703], [215, 703]], [[523, 635], [570, 635], [570, 695], [523, 695]], [[643, 523], [682, 523], [682, 568], [643, 568]], [[97, 516], [152, 516], [152, 589], [97, 589]], [[755, 395], [760, 395], [760, 401], [755, 401]], [[26, 395], [32, 395], [32, 400], [26, 400]], [[678, 364], [728, 362], [731, 430], [681, 432]], [[54, 361], [107, 361], [107, 434], [54, 434]], [[78, 208], [155, 208], [155, 280], [78, 280]], [[643, 205], [693, 205], [693, 272], [643, 272]], [[210, 88], [260, 86], [263, 164], [213, 166]], [[363, 48], [426, 45], [430, 115], [367, 118]]]
+00234400.jpg [[[446, 421], [738, 421], [738, 438], [446, 438]], [[157, 421], [454, 421], [454, 438], [157, 438]], [[158, 394], [652, 394], [652, 411], [158, 411]], [[40, 391], [127, 391], [127, 412], [40, 412]], [[158, 342], [304, 345], [304, 363], [158, 360]], [[38, 344], [123, 344], [123, 362], [38, 362]], [[520, 295], [703, 295], [703, 314], [520, 314]], [[394, 292], [483, 290], [484, 314], [394, 317]], [[157, 293], [270, 293], [270, 313], [157, 313]], [[37, 293], [125, 293], [125, 313], [37, 313]], [[156, 243], [358, 243], [358, 267], [156, 267]], [[36, 243], [82, 243], [82, 269], [36, 269]], [[29, 152], [158, 152], [158, 175], [29, 175]], [[282, 98], [507, 98], [507, 111], [282, 111]], [[315, 46], [475, 50], [474, 88], [314, 85]], [[518, 51], [663, 53], [662, 67], [517, 65]], [[487, 19], [706, 17], [706, 43], [487, 45]]]
+00234883.jpg [[[344, 145], [355, 145], [355, 153], [344, 153]], [[66, 125], [316, 120], [317, 190], [67, 195]], [[79, 138], [109, 141], [108, 152], [78, 148]], [[72, 120], [120, 120], [120, 130], [72, 130]], [[383, 63], [504, 62], [504, 74], [383, 75]], [[58, 29], [365, 26], [366, 112], [59, 115]], [[387, 28], [501, 26], [501, 45], [387, 47]]]
+test_add_0.jpg [[[311, 521], [391, 521], [391, 534], [311, 534]], [[277, 500], [424, 500], [424, 514], [277, 514]], [[261, 446], [437, 446], [437, 459], [261, 459]], [[212, 428], [485, 428], [485, 441], [212, 441]], [[247, 388], [457, 388], [457, 409], [247, 409]], [[222, 328], [474, 328], [474, 372], [222, 372]], [[208, 207], [492, 211], [490, 277], [207, 272]], [[266, 164], [422, 166], [421, 197], [265, 195]], [[18, 20], [201, 18], [201, 43], [18, 45]]]
+test_add_1.png []
+test_add_10.png [[[157, 124], [186, 124], [186, 172], [157, 172]], [[65, 117], [95, 117], [95, 168], [65, 168]], [[161, 106], [183, 106], [183, 127], [161, 127]], [[69, 100], [94, 100], [94, 128], [69, 128]], [[117, 46], [154, 45], [157, 174], [121, 175]], [[66, 34], [97, 34], [97, 112], [66, 112]]]
+test_add_11.jpg [[[1525, 773], [1564, 756], [1575, 780], [1536, 798]], [[1390, 757], [1483, 757], [1483, 791], [1390, 791]], [[1013, 754], [1207, 754], [1207, 800], [1013, 800]], [[685, 755], [875, 755], [875, 796], [685, 796]], [[356, 753], [566, 747], [567, 793], [358, 798]], [[78, 751], [264, 745], [265, 793], [79, 798]], [[602, 647], [1152, 647], [1152, 703], [602, 703]], [[601, 564], [1148, 555], [1149, 611], [602, 620]], [[598, 480], [1066, 472], [1067, 526], [599, 535]], [[598, 393], [1090, 388], [1090, 439], [599, 444]], [[603, 306], [1057, 306], [1057, 357], [603, 357]], [[357, 184], [1517, 184], [1517, 261], [357, 261]], [[60, 43], [257, 37], [259, 83], [61, 89]], [[1305, 41], [1492, 41], [1492, 87], [1305, 87]], [[973, 40], [1171, 34], [1172, 80], [974, 86]], [[670, 40], [862, 34], [864, 80], [671, 86]], [[363, 34], [558, 34], [558, 85], [363, 85]]]
+test_add_12.jpg [[[11, 592], [136, 594], [135, 613], [11, 611]], [[109, 521], [907, 526], [907, 569], [109, 565]], [[635, 451], [902, 448], [903, 478], [635, 481]], [[112, 447], [466, 449], [466, 486], [112, 483]], [[582, 306], [680, 304], [681, 348], [583, 351]], [[369, 261], [565, 266], [563, 357], [367, 353]], [[64, 85], [853, 88], [853, 161], [64, 159]]]
+test_add_13.jpg [[[68, 94], [117, 97], [116, 114], [67, 111]]]
+test_add_14.jpg [[[30, 97], [235, 95], [236, 127], [31, 129]], [[30, 52], [239, 50], [239, 86], [30, 87]]]
+test_add_15.jpg [[[141, 253], [353, 253], [353, 266], [141, 266]], [[205, 214], [406, 219], [406, 232], [204, 227]], [[106, 212], [193, 213], [193, 227], [106, 226]], [[154, 156], [286, 161], [286, 174], [154, 170]], [[148, 136], [305, 142], [305, 156], [147, 150]], [[108, 137], [144, 137], [144, 148], [108, 148]], [[108, 102], [275, 109], [275, 125], [107, 117]], [[107, 72], [245, 79], [245, 96], [106, 88]], [[107, 39], [209, 42], [209, 62], [106, 59]]]
+test_add_16.jpg [[[398, 842], [408, 842], [408, 852], [398, 852]], [[382, 742], [746, 742], [746, 776], [382, 776]], [[362, 703], [468, 703], [468, 725], [362, 725]], [[1552, 701], [1576, 701], [1576, 746], [1552, 746]], [[1256, 695], [1442, 695], [1442, 721], [1256, 721]], [[1244, 661], [1448, 661], [1448, 687], [1244, 687]], [[386, 645], [668, 645], [668, 679], [386, 679]], [[1228, 625], [1470, 623], [1470, 651], [1228, 653]], [[360, 604], [580, 604], [580, 629], [360, 629]], [[1202, 592], [1494, 592], [1494, 617], [1202, 617]], [[1166, 556], [1530, 556], [1530, 582], [1166, 582]], [[380, 552], [638, 552], [638, 586], [380, 586]], [[356, 502], [516, 502], [516, 536], [356, 536]], [[774, 260], [1124, 260], [1124, 300], [774, 300]], [[374, 210], [504, 210], [504, 300], [374, 300]], [[776, 212], [1088, 217], [1088, 252], [776, 248]]]
+test_add_17.jpg [[[321, 255], [393, 258], [392, 271], [320, 269]], [[307, 222], [411, 228], [411, 241], [306, 236]], [[96, 136], [385, 143], [384, 208], [94, 201]], [[72, 95], [399, 103], [398, 124], [71, 117]], [[68, 76], [224, 79], [223, 93], [67, 90]], [[66, 59], [226, 62], [225, 76], [65, 74]]]
+test_add_18.jpg [[[466, 788], [715, 790], [715, 813], [466, 811]], [[553, 752], [665, 757], [663, 791], [552, 786]], [[119, 539], [189, 539], [189, 570], [119, 570]], [[116, 473], [674, 486], [673, 528], [115, 516]], [[121, 429], [669, 441], [668, 470], [121, 457]], [[121, 375], [674, 381], [674, 410], [121, 404]], [[556, 262], [675, 264], [675, 278], [556, 277]], [[164, 259], [334, 259], [334, 273], [164, 273]], [[344, 195], [456, 197], [455, 220], [343, 217]], [[309, 175], [490, 175], [490, 190], [309, 190]], [[255, 128], [537, 131], [537, 169], [254, 165]], [[347, 92], [486, 94], [486, 109], [346, 107]], [[285, 41], [567, 49], [566, 82], [284, 74]], [[236, 32], [266, 32], [266, 60], [236, 60]]]
+test_add_19.jpg [[[24, 294], [42, 294], [42, 302], [24, 302]], [[64, 293], [105, 293], [105, 303], [64, 303]], [[145, 287], [163, 287], [163, 304], [145, 304]], [[63, 280], [106, 280], [106, 290], [63, 290]], [[9, 281], [26, 281], [26, 288], [9, 288]], [[220, 279], [245, 279], [245, 291], [220, 291]], [[177, 279], [208, 279], [208, 290], [177, 290]], [[23, 279], [51, 279], [51, 290], [23, 290]], [[145, 278], [162, 278], [162, 292], [145, 292]], [[8, 267], [18, 267], [18, 276], [8, 276]], [[221, 265], [243, 265], [243, 277], [221, 277]], [[24, 265], [47, 265], [47, 277], [24, 277]], [[142, 263], [163, 263], [163, 279], [142, 279]], [[218, 252], [249, 252], [249, 265], [218, 265]], [[65, 253], [131, 253], [131, 263], [65, 263]], [[24, 252], [43, 252], [43, 264], [24, 264]], [[8, 253], [18, 253], [18, 262], [8, 262]], [[8, 240], [17, 240], [17, 249], [8, 249]], [[63, 237], [114, 237], [114, 251], [63, 251]], [[25, 236], [47, 239], [45, 251], [23, 249]], [[144, 234], [166, 237], [163, 253], [142, 249]], [[494, 226], [531, 226], [531, 239], [494, 239]], [[335, 226], [354, 226], [354, 237], [335, 237]], [[288, 226], [314, 226], [314, 237], [288, 237]], [[63, 226], [113, 226], [113, 236], [63, 236]], [[7, 227], [17, 227], [17, 234], [7, 234]], [[221, 225], [248, 225], [248, 235], [221, 235]], [[143, 225], [165, 222], [167, 234], [145, 237]], [[24, 224], [48, 224], [48, 238], [24, 238]], [[495, 213], [524, 213], [524, 224], [495, 224]], [[420, 212], [437, 212], [437, 225], [420, 225]], [[336, 212], [398, 212], [398, 223], [336, 223]], [[292, 212], [320, 212], [320, 223], [292, 223]], [[222, 212], [249, 212], [249, 223], [222, 223]], [[145, 212], [166, 212], [166, 223], [145, 223]], [[61, 211], [113, 209], [114, 222], [62, 224]], [[26, 211], [48, 211], [48, 223], [26, 223]], [[337, 199], [383, 199], [383, 209], [337, 209]], [[65, 200], [87, 200], [87, 207], [65, 207]], [[493, 197], [541, 197], [541, 211], [493, 211]], [[445, 202], [455, 196], [462, 206], [452, 212]], [[178, 198], [205, 198], [205, 208], [178, 208]], [[146, 199], [157, 199], [157, 208], [146, 208]], [[32, 194], [43, 204], [33, 214], [22, 203]], [[422, 193], [440, 201], [432, 215], [415, 207]], [[65, 186], [132, 186], [132, 196], [65, 196]], [[337, 185], [399, 185], [399, 196], [337, 196]], [[445, 190], [456, 182], [465, 191], [454, 200]], [[292, 188], [308, 182], [313, 193], [297, 200]], [[220, 183], [255, 183], [255, 197], [220, 197]], [[142, 184], [158, 184], [158, 197], [142, 197]], [[493, 182], [518, 182], [518, 197], [493, 197]], [[425, 180], [437, 191], [427, 202], [414, 190]], [[32, 179], [42, 189], [32, 199], [22, 189]], [[182, 179], [195, 185], [188, 198], [175, 192]], [[335, 172], [400, 169], [400, 183], [336, 185]], [[492, 170], [519, 170], [519, 185], [492, 185]], [[412, 177], [428, 164], [440, 178], [425, 190]], [[293, 171], [315, 171], [315, 185], [293, 185]], [[220, 170], [251, 170], [251, 184], [220, 184]], [[178, 172], [188, 172], [188, 183], [178, 183]], [[64, 172], [125, 170], [125, 181], [64, 182]], [[454, 168], [464, 176], [454, 185], [445, 176]], [[142, 172], [159, 168], [163, 180], [145, 185]], [[30, 165], [43, 174], [34, 186], [20, 177]], [[493, 160], [523, 160], [523, 170], [493, 170]], [[402, 161], [435, 161], [435, 168], [402, 168]], [[335, 159], [401, 159], [401, 169], [335, 169]], [[296, 159], [325, 159], [325, 170], [296, 170]], [[221, 158], [251, 158], [251, 169], [221, 169]], [[174, 161], [183, 156], [190, 167], [181, 172]], [[145, 158], [162, 158], [162, 170], [145, 170]], [[61, 158], [125, 157], [125, 168], [62, 169]], [[20, 161], [33, 154], [40, 167], [28, 174]], [[492, 143], [542, 143], [542, 157], [492, 157]], [[450, 144], [479, 144], [479, 157], [450, 157]], [[335, 143], [439, 143], [439, 156], [335, 156]], [[294, 143], [327, 143], [327, 157], [294, 157]], [[220, 143], [253, 143], [253, 157], [220, 157]], [[178, 145], [187, 145], [187, 156], [178, 156]], [[63, 144], [104, 144], [104, 155], [63, 155]], [[144, 140], [164, 145], [160, 159], [141, 154]], [[31, 137], [44, 149], [31, 162], [17, 149]], [[286, 135], [291, 135], [291, 140], [286, 140]], [[177, 133], [193, 133], [193, 144], [177, 144]], [[336, 132], [388, 132], [388, 141], [336, 141]], [[492, 131], [525, 131], [525, 141], [492, 141]], [[450, 131], [477, 131], [477, 141], [450, 141]], [[292, 131], [321, 131], [321, 141], [292, 141]], [[218, 132], [255, 130], [256, 141], [219, 144]], [[63, 131], [95, 131], [95, 141], [63, 141]], [[417, 130], [437, 130], [437, 141], [417, 141]], [[145, 130], [159, 130], [159, 143], [145, 143]], [[30, 124], [43, 133], [32, 147], [19, 138]], [[493, 118], [535, 118], [535, 129], [493, 129]], [[336, 118], [388, 118], [388, 129], [336, 129]], [[218, 118], [255, 118], [255, 128], [218, 128]], [[451, 117], [478, 117], [478, 129], [451, 129]], [[418, 117], [438, 117], [438, 130], [418, 130]], [[177, 116], [209, 116], [209, 130], [177, 130]], [[145, 117], [162, 117], [162, 130], [145, 130]], [[62, 116], [88, 116], [88, 131], [62, 131]], [[19, 121], [33, 111], [43, 124], [29, 134]], [[491, 107], [523, 107], [523, 113], [491, 113]], [[449, 107], [477, 107], [477, 113], [449, 113]], [[420, 107], [436, 107], [436, 113], [420, 113]], [[295, 107], [319, 107], [319, 114], [295, 114]], [[220, 107], [242, 107], [242, 113], [220, 113]], [[176, 107], [203, 107], [203, 113], [176, 113]], [[145, 107], [161, 107], [161, 114], [145, 114]], [[334, 105], [372, 105], [372, 114], [334, 114]], [[63, 106], [86, 106], [86, 113], [63, 113]], [[483, 89], [522, 89], [522, 99], [483, 99]], [[331, 88], [380, 88], [380, 99], [331, 99]], [[276, 88], [325, 88], [325, 99], [276, 99]], [[214, 88], [246, 88], [246, 99], [214, 99]], [[411, 86], [474, 86], [474, 100], [411, 100]], [[6, 86], [102, 86], [102, 100], [6, 100]], [[415, 66], [461, 66], [461, 77], [415, 77]], [[288, 66], [333, 66], [333, 77], [288, 77]], [[157, 64], [206, 64], [206, 78], [157, 78]], [[416, 48], [523, 49], [523, 63], [415, 62]], [[288, 49], [375, 49], [375, 63], [288, 63]], [[159, 49], [269, 49], [269, 62], [159, 62]], [[24, 53], [36, 46], [45, 59], [33, 67]], [[416, 36], [481, 36], [481, 46], [416, 46]], [[25, 38], [39, 32], [46, 46], [33, 52]], [[157, 34], [205, 34], [205, 47], [157, 47]], [[412, 4], [527, 4], [527, 17], [412, 17]], [[146, 4], [345, 2], [345, 15], [146, 17]]]
+test_add_20.jpg [[[31, 346], [605, 346], [605, 370], [31, 370]], [[217, 294], [510, 294], [510, 322], [217, 322]], [[473, 271], [525, 271], [525, 286], [473, 286]], [[220, 267], [287, 267], [287, 286], [220, 286]], [[219, 239], [484, 239], [484, 263], [219, 263]], [[221, 217], [303, 217], [303, 234], [221, 234]], [[402, 192], [417, 192], [417, 205], [402, 205]], [[222, 187], [341, 187], [341, 207], [222, 207]], [[221, 162], [287, 162], [287, 180], [221, 180]], [[375, 122], [475, 124], [475, 146], [375, 143]], [[222, 124], [356, 122], [356, 143], [222, 146]], [[218, 81], [352, 84], [352, 116], [218, 113]], [[440, 35], [605, 35], [605, 60], [440, 60]], [[72, 16], [398, 16], [398, 44], [72, 44]]]
+test_add_3.jpg [[[169, 327], [337, 326], [337, 341], [169, 342]], [[170, 288], [307, 290], [307, 312], [170, 310]], [[171, 221], [323, 221], [323, 234], [171, 234]], [[340, 221], [449, 217], [449, 231], [341, 234]], [[169, 201], [372, 201], [372, 214], [169, 214]], [[170, 183], [418, 183], [418, 196], [170, 196]], [[170, 149], [416, 149], [416, 163], [170, 163]], [[171, 119], [418, 119], [418, 140], [171, 140]], [[326, 64], [478, 64], [478, 91], [326, 91]], [[173, 64], [306, 60], [306, 89], [174, 93]]]
+test_add_4.png []
+test_add_5.png [[[48, 164], [108, 164], [108, 174], [48, 174]], [[52, 121], [169, 121], [169, 134], [52, 134]], [[50, 102], [165, 102], [165, 118], [50, 118]], [[52, 83], [164, 83], [164, 100], [52, 100]], [[51, 68], [166, 68], [166, 84], [51, 84]], [[51, 50], [145, 47], [145, 64], [52, 67]]]
+test_add_6.jpg [[[123, 223], [219, 227], [218, 251], [122, 247]], [[172, 172], [186, 186], [172, 200], [158, 186]]]
+test_add_7.jpg [[[48, 938], [174, 936], [174, 962], [48, 964]], [[227, 873], [629, 876], [628, 953], [226, 949]], [[56, 745], [638, 745], [638, 790], [56, 790]], [[150, 674], [545, 678], [544, 721], [150, 718]], [[73, 504], [633, 504], [633, 601], [73, 601]], [[59, 270], [655, 279], [652, 441], [56, 432]], [[513, 193], [553, 193], [553, 223], [513, 223]], [[61, 175], [532, 175], [532, 239], [61, 239]], [[533, 178], [642, 178], [642, 236], [533, 236]]]
+test_add_8.jpg [[[251, 586], [454, 580], [454, 606], [252, 613]], [[107, 533], [457, 527], [457, 560], [108, 566]], [[336, 494], [384, 494], [384, 507], [336, 507]], [[27, 307], [355, 297], [356, 320], [28, 330]], [[22, 259], [445, 251], [445, 274], [23, 282]], [[78, 209], [445, 205], [445, 225], [78, 229]], [[160, 23], [319, 30], [317, 79], [158, 72]]]
+test_add_9.png [[[266, 687], [486, 687], [486, 696], [266, 696]], [[196, 668], [554, 668], [554, 681], [196, 681]], [[154, 596], [597, 596], [597, 606], [154, 606]], [[215, 578], [541, 578], [541, 588], [215, 588]], [[134, 560], [615, 560], [615, 570], [134, 570]], [[85, 543], [665, 543], [665, 553], [85, 553]], [[96, 522], [653, 522], [653, 535], [96, 535]], [[362, 449], [389, 449], [389, 460], [362, 460]], [[238, 376], [513, 376], [513, 389], [238, 389]], [[177, 356], [574, 356], [574, 368], [177, 368]], [[344, 281], [408, 283], [407, 297], [343, 294]], [[257, 205], [493, 205], [493, 219], [257, 219]]]
diff --git a/tools/eval.py b/tools/eval.py
index fb8c7925adac33b0693792a6736c603511e3e3ae..39a26ffefff46a9a3fe1465e874d501a334921c7 100755
--- a/tools/eval.py
+++ b/tools/eval.py
@@ -27,7 +27,7 @@ from ppocr.data import build_dataloader
from ppocr.modeling.architectures import build_model
from ppocr.postprocess import build_post_process
from ppocr.metrics import build_metric
-from ppocr.utils.save_load import init_model, load_pretrained_params
+from ppocr.utils.save_load import init_model, load_dygraph_params
from ppocr.utils.utility import print_dict
import tools.program as program
@@ -61,7 +61,7 @@ def main():
else:
model_type = None
- best_model_dict = init_model(config, model)
+ best_model_dict = load_dygraph_params(config, model, logger, None)
if len(best_model_dict):
logger.info('metric in ckpt ***************')
for k, v in best_model_dict.items():
diff --git a/tools/export_model.py b/tools/export_model.py
index 785aca10e46200bda49bdff2b89ba00cafbe7a20..cae87aca129134d64711e364bf10428d69500a06 100755
--- a/tools/export_model.py
+++ b/tools/export_model.py
@@ -93,6 +93,9 @@ def main():
for key in config["Architecture"]["Models"]:
config["Architecture"]["Models"][key]["Head"][
"out_channels"] = char_num
+ # just one final tensor needs to to exported for inference
+ config["Architecture"]["Models"][key][
+ "return_all_feats"] = False
else: # base rec model
config["Architecture"]["Head"]["out_channels"] = char_num
model = build_model(config["Architecture"])
diff --git a/tools/infer/predict_det.py b/tools/infer/predict_det.py
index 5c75e0c480eac6796d6d4b7075d1b38d254380fd..6347ca6dc719f0d489736dbf285eedd775d3790e 100755
--- a/tools/infer/predict_det.py
+++ b/tools/infer/predict_det.py
@@ -30,7 +30,7 @@ from ppocr.utils.logging import get_logger
from ppocr.utils.utility import get_image_file_list, check_and_read_gif
from ppocr.data import create_operators, transform
from ppocr.postprocess import build_post_process
-
+import json
logger = get_logger()
@@ -243,6 +243,7 @@ if __name__ == "__main__":
if not os.path.exists(draw_img_save):
os.makedirs(draw_img_save)
+ save_results = []
for image_file in image_file_list:
img, flag = check_and_read_gif(image_file)
if not flag:
@@ -256,8 +257,11 @@ if __name__ == "__main__":
if count > 0:
total_time += elapse
count += 1
-
- logger.info("Predict time of {}: {}".format(image_file, elapse))
+ save_pred = os.path.basename(image_file) + "\t" + str(
+ json.dumps(np.array(dt_boxes).astype(np.int32).tolist())) + "\n"
+ save_results.append(save_pred)
+ logger.info(save_pred)
+ logger.info("The predict time of {}: {}".format(image_file, elapse))
src_im = utility.draw_text_det_res(dt_boxes, image_file)
img_name_pure = os.path.split(image_file)[-1]
img_path = os.path.join(draw_img_save,
@@ -265,5 +269,8 @@ if __name__ == "__main__":
cv2.imwrite(img_path, src_im)
logger.info("The visualized image saved in {}".format(img_path))
+ with open(os.path.join(draw_img_save, "det_results.txt"), 'w') as f:
+ f.writelines(save_results)
+ f.close()
if args.benchmark:
text_detector.autolog.report()
diff --git a/tools/infer/utility.py b/tools/infer/utility.py
index 707328f28468db86c5061795d04713dc3b21a5cb..7f60773c3e76aa4bf66caeb29dc2968be49cc51a 100755
--- a/tools/infer/utility.py
+++ b/tools/infer/utility.py
@@ -35,7 +35,7 @@ def init_args():
parser.add_argument("--use_gpu", type=str2bool, default=True)
parser.add_argument("--ir_optim", type=str2bool, default=True)
parser.add_argument("--use_tensorrt", type=str2bool, default=False)
- parser.add_argument("--min_subgraph_size", type=int, default=10)
+ parser.add_argument("--min_subgraph_size", type=int, default=15)
parser.add_argument("--precision", type=str, default="fp32")
parser.add_argument("--gpu_mem", type=int, default=500)
diff --git a/tools/infer_det.py b/tools/infer_det.py
index a964cd28c934504ce79ea4873d3345295c1266e5..ce16da8dc5fffb3f5fdc633aeb00a386a2d60d4f 100755
--- a/tools/infer_det.py
+++ b/tools/infer_det.py
@@ -34,23 +34,21 @@ import paddle
from ppocr.data import create_operators, transform
from ppocr.modeling.architectures import build_model
from ppocr.postprocess import build_post_process
-from ppocr.utils.save_load import init_model
+from ppocr.utils.save_load import init_model, load_dygraph_params
from ppocr.utils.utility import get_image_file_list
import tools.program as program
-def draw_det_res(dt_boxes, config, img, img_name):
+def draw_det_res(dt_boxes, config, img, img_name, save_path):
if len(dt_boxes) > 0:
import cv2
src_im = img
for box in dt_boxes:
box = box.astype(np.int32).reshape((-1, 1, 2))
cv2.polylines(src_im, [box], True, color=(255, 255, 0), thickness=2)
- save_det_path = os.path.dirname(config['Global'][
- 'save_res_path']) + "/det_results/"
- if not os.path.exists(save_det_path):
- os.makedirs(save_det_path)
- save_path = os.path.join(save_det_path, os.path.basename(img_name))
+ if not os.path.exists(save_path):
+ os.makedirs(save_path)
+ save_path = os.path.join(save_path, os.path.basename(img_name))
cv2.imwrite(save_path, src_im)
logger.info("The detected Image saved in {}".format(save_path))
@@ -61,8 +59,7 @@ def main():
# build model
model = build_model(config['Architecture'])
- init_model(config, model)
-
+ _ = load_dygraph_params(config, model, logger, None)
# build post process
post_process_class = build_post_process(config['PostProcess'])
@@ -96,17 +93,41 @@ def main():
images = paddle.to_tensor(images)
preds = model(images)
post_result = post_process_class(preds, shape_list)
- boxes = post_result[0]['points']
- # write result
+
+ src_img = cv2.imread(file)
+
dt_boxes_json = []
- for box in boxes:
- tmp_json = {"transcription": ""}
- tmp_json['points'] = box.tolist()
- dt_boxes_json.append(tmp_json)
+ # parser boxes if post_result is dict
+ if isinstance(post_result, dict):
+ det_box_json = {}
+ for k in post_result.keys():
+ boxes = post_result[k][0]['points']
+ dt_boxes_list = []
+ for box in boxes:
+ tmp_json = {"transcription": ""}
+ tmp_json['points'] = box.tolist()
+ dt_boxes_list.append(tmp_json)
+ det_box_json[k] = dt_boxes_list
+ save_det_path = os.path.dirname(config['Global'][
+ 'save_res_path']) + "/det_results_{}/".format(k)
+ draw_det_res(boxes, config, src_img, file, save_det_path)
+ else:
+ boxes = post_result[0]['points']
+ dt_boxes_json = []
+ # write result
+ for box in boxes:
+ tmp_json = {"transcription": ""}
+ tmp_json['points'] = box.tolist()
+ dt_boxes_json.append(tmp_json)
+ save_det_path = os.path.dirname(config['Global'][
+ 'save_res_path']) + "/det_results/"
+ draw_det_res(boxes, config, src_img, file, save_det_path)
otstr = file + "\t" + json.dumps(dt_boxes_json) + "\n"
fout.write(otstr.encode())
- src_img = cv2.imread(file)
- draw_det_res(boxes, config, src_img, file)
+
+ save_det_path = os.path.dirname(config['Global'][
+ 'save_res_path']) + "/det_results/"
+ draw_det_res(boxes, config, src_img, file, save_det_path)
logger.info("success!")
diff --git a/tools/infer_rec.py b/tools/infer_rec.py
index f16cd7d327987db2630743e14c633ddf3743f8d3..29d4b530dfcfb8a3201e12b38c9b9f186f34b627 100755
--- a/tools/infer_rec.py
+++ b/tools/infer_rec.py
@@ -130,7 +130,7 @@ def main():
if len(post_result[key][0]) >= 2:
rec_info[key] = {
"label": post_result[key][0][0],
- "score": post_result[key][0][1],
+ "score": float(post_result[key][0][1]),
}
info = json.dumps(rec_info)
else: