From b47ab9bb71564d4ef2ea94456e4097f0d8ef94c0 Mon Sep 17 00:00:00 2001
From: WenmuZhou <zjwenmu@gmail.com>
Date: Mon, 19 Jul 2021 11:19:59 +0800
Subject: [PATCH 1/6] add /path/to to gen_label doc

---
 doc/doc_ch/detection.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/doc_ch/detection.md b/doc/doc_ch/detection.md
index 08b309cbc..ae16ec991 100644
--- a/doc/doc_ch/detection.md
+++ b/doc/doc_ch/detection.md
@@ -18,7 +18,7 @@ PaddleOCR 也提供了数据格式转换脚本,可以将官网 label 转换支
 
 ```
 # 将官网下载的标签文件转换为 train_icdar2015_label.txt
-python gen_label.py --mode="det" --root_path="icdar_c4_train_imgs/"  \
+python gen_label.py --mode="det" --root_path="/path/to/icdar_c4_train_imgs/"  \
                     --input_path="ch4_training_localization_transcription_gt" \
                     --output_label="train_icdar2015_label.txt"
 ```

From 93181fb4d18989d358adfd48dd4e889228faa916 Mon Sep 17 00:00:00 2001
From: WenmuZhou <zjwenmu@gmail.com>
Date: Mon, 19 Jul 2021 15:41:55 +0800
Subject: [PATCH 2/6] add encoding type to file

---
 ppocr/utils/gen_label.py | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/ppocr/utils/gen_label.py b/ppocr/utils/gen_label.py
index 43afe9ddf..fb78bd38b 100644
--- a/ppocr/utils/gen_label.py
+++ b/ppocr/utils/gen_label.py
@@ -1,16 +1,16 @@
-#copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
+# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
 #
-#Licensed under the Apache License, Version 2.0 (the "License");
-#you may not use this file except in compliance with the License.
-#You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
 #
 #    http://www.apache.org/licenses/LICENSE-2.0
 #
-#Unless required by applicable law or agreed to in writing, software
-#distributed under the License is distributed on an "AS IS" BASIS,
-#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#See the License for the specific language governing permissions and
-#limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 import os
 import argparse
 import json
@@ -31,7 +31,9 @@ def gen_det_label(root_path, input_dir, out_label):
         for label_file in os.listdir(input_dir):
             img_path = root_path + label_file[3:-4] + ".jpg"
             label = []
-            with open(os.path.join(input_dir, label_file), 'r') as f:
+            with open(
+                    os.path.join(input_dir, label_file), 'r',
+                    encoding='utf-8-sig') as f:
                 for line in f.readlines():
                     tmp = line.strip("\n\r").replace("\xef\xbb\xbf",
                                                      "").split(',')

From 9d33e6135422af9a78830bc211a49521ee1253a9 Mon Sep 17 00:00:00 2001
From: WenmuZhou <zjwenmu@gmail.com>
Date: Mon, 19 Jul 2021 16:04:48 +0800
Subject: [PATCH 3/6] add path to det doc

---
 doc/doc_ch/detection.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/doc_ch/detection.md b/doc/doc_ch/detection.md
index ae16ec991..6fc85992c 100644
--- a/doc/doc_ch/detection.md
+++ b/doc/doc_ch/detection.md
@@ -19,8 +19,8 @@ PaddleOCR 也提供了数据格式转换脚本,可以将官网 label 转换支
 ```
 # 将官网下载的标签文件转换为 train_icdar2015_label.txt
 python gen_label.py --mode="det" --root_path="/path/to/icdar_c4_train_imgs/"  \
-                    --input_path="ch4_training_localization_transcription_gt" \
-                    --output_label="train_icdar2015_label.txt"
+                    --input_path="/path/to/ch4_training_localization_transcription_gt" \
+                    --output_label="/path/to/train_icdar2015_label.txt"
 ```
 
 解压数据集和下载标注文件后,PaddleOCR/train_data/ 有两个文件夹和两个文件,分别是:

From 5c848fdf564cb5ce207b8dc71b12b4da4715f7f8 Mon Sep 17 00:00:00 2001
From: WenmuZhou <zjwenmu@gmail.com>
Date: Mon, 19 Jul 2021 20:16:14 +0800
Subject: [PATCH 4/6] opt cpp_infer doc

---
 deploy/cpp_infer/readme.md    | 1 +
 deploy/cpp_infer/readme_en.md | 1 +
 2 files changed, 2 insertions(+)

diff --git a/deploy/cpp_infer/readme.md b/deploy/cpp_infer/readme.md
index 6a57044b0..a66b2a5a8 100644
--- a/deploy/cpp_infer/readme.md
+++ b/deploy/cpp_infer/readme.md
@@ -18,6 +18,7 @@ PaddleOCR模型部署。
 * 首先需要从opencv官网上下载在Linux环境下源码编译的包,以opencv3.4.7为例,下载命令如下。
 
 ```
+cd deploy/cpp_infer
 wget https://github.com/opencv/opencv/archive/3.4.7.tar.gz
 tar -xf 3.4.7.tar.gz
 ```
diff --git a/deploy/cpp_infer/readme_en.md b/deploy/cpp_infer/readme_en.md
index 6c0a18db4..b03187a76 100644
--- a/deploy/cpp_infer/readme_en.md
+++ b/deploy/cpp_infer/readme_en.md
@@ -18,6 +18,7 @@ PaddleOCR model deployment.
 * First of all, you need to download the source code compiled package in the Linux environment from the opencv official website. Taking opencv3.4.7 as an example, the download command is as follows.
 
 ```
+cd deploy/cpp_infer
 wget https://github.com/opencv/opencv/archive/3.4.7.tar.gz
 tar -xf 3.4.7.tar.gz
 ```

From d401e53b905af0a1591ca3eb8abd776afe37b3fc Mon Sep 17 00:00:00 2001
From: WenmuZhou <zjwenmu@gmail.com>
Date: Thu, 22 Jul 2021 19:13:27 +0800
Subject: [PATCH 5/6] opt doc

---
 doc/doc_ch/inference.md    | 2 +-
 doc/doc_en/inference_en.md | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/doc_ch/inference.md b/doc/doc_ch/inference.md
index 97e3b92bd..3d8bfa168 100755
--- a/doc/doc_ch/inference.md
+++ b/doc/doc_ch/inference.md
@@ -221,7 +221,7 @@ python3 tools/export_model.py -c configs/det/det_r50_vd_sast_totaltext.yml -o Gl
 
 ```
 
-**SAST文本检测模型推理,需要设置参数`--det_algorithm="SAST"`,同时,还需要增加参数`--det_sast_polygon=True`,**可以执行如下命令:
+SAST文本检测模型推理,需要设置参数`--det_algorithm="SAST"`,同时,还需要增加参数`--det_sast_polygon=True`,可以执行如下命令:
 ```
 python3 tools/infer/predict_det.py --det_algorithm="SAST" --image_dir="./doc/imgs_en/img623.jpg" --det_model_dir="./inference/det_sast_tt/" --det_sast_polygon=True
 ```
diff --git a/doc/doc_en/inference_en.md b/doc/doc_en/inference_en.md
index a78bb6b6f..b46f9fd58 100755
--- a/doc/doc_en/inference_en.md
+++ b/doc/doc_en/inference_en.md
@@ -230,7 +230,7 @@ First, convert the model saved in the SAST text detection training process into
 python3 tools/export_model.py -c configs/det/det_r50_vd_sast_totaltext.yml -o Global.pretrained_model=./det_r50_vd_sast_totaltext_v2.0_train/best_accuracy  Global.save_inference_dir=./inference/det_sast_tt
 ```
 
-**For SAST curved text detection model inference, you need to set the parameter `--det_algorithm="SAST"` and `--det_sast_polygon=True`**, run the following command:
+For SAST curved text detection model inference, you need to set the parameter `--det_algorithm="SAST"` and `--det_sast_polygon=True`, run the following command:
 
 ```
 python3 tools/infer/predict_det.py --det_algorithm="SAST" --image_dir="./doc/imgs_en/img623.jpg" --det_model_dir="./inference/det_sast_tt/" --det_sast_polygon=True

From 872eeb512c71edee1326f4e502f312b9504590a2 Mon Sep 17 00:00:00 2001
From: WenmuZhou <zjwenmu@gmail.com>
Date: Fri, 23 Jul 2021 13:38:27 +0800
Subject: [PATCH 6/6] opt doc

---
 deploy/hubserving/readme.md    | 1 +
 deploy/hubserving/readme_en.md | 1 +
 2 files changed, 2 insertions(+)

diff --git a/deploy/hubserving/readme.md b/deploy/hubserving/readme.md
index 9351fa8d4..11b843fec 100755
--- a/deploy/hubserving/readme.md
+++ b/deploy/hubserving/readme.md
@@ -29,6 +29,7 @@ deploy/hubserving/ocr_system/
 ### 1. 准备环境
 ```shell
 # 安装paddlehub  
+# paddlehub 需要 python>3.6.2
 pip3 install paddlehub==2.1.0 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple
 ```
 
diff --git a/deploy/hubserving/readme_en.md b/deploy/hubserving/readme_en.md
index 98ffcad63..539ad722c 100755
--- a/deploy/hubserving/readme_en.md
+++ b/deploy/hubserving/readme_en.md
@@ -30,6 +30,7 @@ The following steps take the 2-stage series service as an example. If only the d
 ### 1. Prepare the environment
 ```shell
 # Install paddlehub  
+# python>3.6.2 is required bt paddlehub
 pip3 install paddlehub==2.1.0 --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple
 ```