From a0fd1a48a1b54ecd80f7439d31aaec2466e14beb Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Fri, 12 Mar 2021 17:15:48 +0800 Subject: [PATCH 1/9] fix srn infer error when use custom max_text_length --- tools/infer/predict_rec.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/infer/predict_rec.py b/tools/infer/predict_rec.py index 1cb6e01b..24388026 100755 --- a/tools/infer/predict_rec.py +++ b/tools/infer/predict_rec.py @@ -41,6 +41,7 @@ class TextRecognizer(object): self.character_type = args.rec_char_type self.rec_batch_num = args.rec_batch_num self.rec_algorithm = args.rec_algorithm + self.max_text_length = args.max_text_length postprocess_params = { 'name': 'CTCLabelDecode', "character_type": args.rec_char_type, @@ -186,8 +187,9 @@ class TextRecognizer(object): norm_img = norm_img[np.newaxis, :] norm_img_batch.append(norm_img) else: - norm_img = self.process_image_srn( - img_list[indices[ino]], self.rec_image_shape, 8, 25) + norm_img = self.process_image_srn(img_list[indices[ino]], + self.rec_image_shape, 8, + self.max_text_length) encoder_word_pos_list = [] gsrm_word_pos_list = [] gsrm_slf_attn_bias1_list = [] From 86f4abf7d5b87c69b1fcc90dfdc22df37ddf737b Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Fri, 9 Apr 2021 10:19:34 +0000 Subject: [PATCH 2/9] add supprt for multi process inference --- ppocr/utils/utility.py | 1 + tools/infer/predict_system.py | 1 + tools/infer/predict_system_mp.py | 46 ++++++++++++++++++++++++++++++++ tools/infer/utility.py | 4 +++ 4 files changed, 52 insertions(+) create mode 100755 tools/infer/predict_system_mp.py diff --git a/ppocr/utils/utility.py b/ppocr/utils/utility.py index 29576d97..7bb4c906 100755 --- a/ppocr/utils/utility.py +++ b/ppocr/utils/utility.py @@ -61,6 +61,7 @@ def get_image_file_list(img_file): imgs_lists.append(file_path) if len(imgs_lists) == 0: raise Exception("not found any img file in {}".format(img_file)) + imgs_lists = sorted(imgs_lists) return imgs_lists diff --git a/tools/infer/predict_system.py b/tools/infer/predict_system.py index de7ee9d3..1014475d 100755 --- a/tools/infer/predict_system.py +++ b/tools/infer/predict_system.py @@ -141,6 +141,7 @@ def sorted_boxes(dt_boxes): def main(args): image_file_list = get_image_file_list(args.image_dir) + image_file_list = image_file_list[args.process_id::args.total_process_num] text_sys = TextSystem(args) is_visualize = True font_path = args.vis_font_path diff --git a/tools/infer/predict_system_mp.py b/tools/infer/predict_system_mp.py new file mode 100755 index 00000000..42373ee8 --- /dev/null +++ b/tools/infer/predict_system_mp.py @@ -0,0 +1,46 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +# +# 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. +import os +import sys +import paddle +import subprocess + +__dir__ = os.path.dirname(os.path.abspath(__file__)) +sys.path.append(__dir__) +sys.path.append(os.path.abspath(os.path.join(__dir__, '../..'))) + +import tools.infer.utility as utility + +if __name__ == "__main__": + args = utility.parse_args() + + p_list = [] + + inference_dir = "inference_results" + if not os.path.exists(inference_dir): + os.makedirs(inference_dir) + + total_process_num = args.total_process_num + for process_id in range(total_process_num): + cmd = [sys.executable, "-u", "tools/infer/predict_system.py" + ] + sys.argv[1:] + ["--process_id={}".format(process_id)] + + with open("{}/results.{}".format(inference_dir, process_id), + "w") as fin: + p = subprocess.Popen(cmd, stdout=fin, stderr=fin) + # if you want to print results in the screen, you can use the following command + # p = subprocess.Popen(cmd, stdout=fin, stderr=sys.stdout) + p_list.append(p) + for p in p_list: + p.wait() diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 911ca7fc..d84332cc 100755 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -85,6 +85,10 @@ def parse_args(): parser.add_argument("--enable_mkldnn", type=str2bool, default=False) parser.add_argument("--use_pdserving", type=str2bool, default=False) + parser.add_argument("--use_multiprocess", type=str2bool, default=False) + parser.add_argument("--total_process_num", type=int, default=1) + parser.add_argument("--process_id", type=int, default=0) + return parser.parse_args() From e19bedf52316e06a3c4039e1e5dff9ad6c318fe8 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Fri, 9 Apr 2021 10:28:06 +0000 Subject: [PATCH 3/9] fix infer --- tools/infer/predict_system_mp.py | 6 ++++-- tools/infer/utility.py | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/infer/predict_system_mp.py b/tools/infer/predict_system_mp.py index 42373ee8..a4c3bf39 100755 --- a/tools/infer/predict_system_mp.py +++ b/tools/infer/predict_system_mp.py @@ -38,9 +38,11 @@ if __name__ == "__main__": with open("{}/results.{}".format(inference_dir, process_id), "w") as fin: - p = subprocess.Popen(cmd, stdout=fin, stderr=fin) + # p = subprocess.Popen(cmd, stdout=fin, stderr=fin) # if you want to print results in the screen, you can use the following command - # p = subprocess.Popen(cmd, stdout=fin, stderr=sys.stdout) + p = subprocess.Popen(cmd, stdout=sys.stdout, stderr=sys.stdout) p_list.append(p) for p in p_list: p.wait() + print("all inference results are save in directory: {}".format( + inference_dir)) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index d84332cc..a264be5f 100755 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -85,7 +85,6 @@ def parse_args(): parser.add_argument("--enable_mkldnn", type=str2bool, default=False) parser.add_argument("--use_pdserving", type=str2bool, default=False) - parser.add_argument("--use_multiprocess", type=str2bool, default=False) parser.add_argument("--total_process_num", type=int, default=1) parser.add_argument("--process_id", type=int, default=0) From 916cec34c6a5be1bd2822094f275e17814b098dd Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Fri, 9 Apr 2021 11:50:01 +0000 Subject: [PATCH 4/9] unify predict mp and sp --- tools/infer/predict_system.py | 17 ++++++++++- tools/infer/predict_system_mp.py | 48 -------------------------------- tools/infer/utility.py | 1 + 3 files changed, 17 insertions(+), 49 deletions(-) delete mode 100755 tools/infer/predict_system_mp.py diff --git a/tools/infer/predict_system.py b/tools/infer/predict_system.py index 1014475d..b77c9443 100755 --- a/tools/infer/predict_system.py +++ b/tools/infer/predict_system.py @@ -13,6 +13,7 @@ # limitations under the License. import os import sys +import subprocess __dir__ = os.path.dirname(os.path.abspath(__file__)) sys.path.append(__dir__) @@ -185,4 +186,18 @@ def main(args): if __name__ == "__main__": - main(utility.parse_args()) + args = utility.parse_args() + if args.use_mp: + p_list = [] + total_process_num = args.total_process_num + for process_id in range(total_process_num): + cmd = [sys.executable, "-u"] + sys.argv + [ + "--process_id={} ".format(process_id), + "--use_mp={} ".format(args.use_mp) + ] + p = subprocess.Popen(cmd, stdout=sys.stdout, stderr=sys.stdout) + p_list.append(p) + for p in p_list: + p.wait() + else: + main(args) diff --git a/tools/infer/predict_system_mp.py b/tools/infer/predict_system_mp.py deleted file mode 100755 index a4c3bf39..00000000 --- a/tools/infer/predict_system_mp.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# 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. -import os -import sys -import paddle -import subprocess - -__dir__ = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(__dir__) -sys.path.append(os.path.abspath(os.path.join(__dir__, '../..'))) - -import tools.infer.utility as utility - -if __name__ == "__main__": - args = utility.parse_args() - - p_list = [] - - inference_dir = "inference_results" - if not os.path.exists(inference_dir): - os.makedirs(inference_dir) - - total_process_num = args.total_process_num - for process_id in range(total_process_num): - cmd = [sys.executable, "-u", "tools/infer/predict_system.py" - ] + sys.argv[1:] + ["--process_id={}".format(process_id)] - - with open("{}/results.{}".format(inference_dir, process_id), - "w") as fin: - # p = subprocess.Popen(cmd, stdout=fin, stderr=fin) - # if you want to print results in the screen, you can use the following command - p = subprocess.Popen(cmd, stdout=sys.stdout, stderr=sys.stdout) - p_list.append(p) - for p in p_list: - p.wait() - print("all inference results are save in directory: {}".format( - inference_dir)) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index fc416fd8..b273eaf3 100755 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -98,6 +98,7 @@ def parse_args(): parser.add_argument("--enable_mkldnn", type=str2bool, default=False) parser.add_argument("--use_pdserving", type=str2bool, default=False) + parser.add_argument("--use_mp", type=str2bool, default=False) parser.add_argument("--total_process_num", type=int, default=1) parser.add_argument("--process_id", type=int, default=0) From d6eb34f65c23d18c7bb68b1bde5fc830e9352081 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Fri, 9 Apr 2021 12:28:49 +0000 Subject: [PATCH 5/9] fix infer --- tools/infer/predict_system.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/infer/predict_system.py b/tools/infer/predict_system.py index b77c9443..ebfcd812 100755 --- a/tools/infer/predict_system.py +++ b/tools/infer/predict_system.py @@ -188,12 +188,13 @@ def main(args): if __name__ == "__main__": args = utility.parse_args() if args.use_mp: + print("12233") p_list = [] total_process_num = args.total_process_num for process_id in range(total_process_num): cmd = [sys.executable, "-u"] + sys.argv + [ - "--process_id={} ".format(process_id), - "--use_mp={} ".format(args.use_mp) + "--process_id={}".format(process_id), + "--use_mp={}".format(False) ] p = subprocess.Popen(cmd, stdout=sys.stdout, stderr=sys.stdout) p_list.append(p) From 3de964a4b86e7be5b4a7e44efb5afe0a31d43503 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Fri, 9 Apr 2021 12:30:42 +0000 Subject: [PATCH 6/9] fix print --- tools/infer/predict_system.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/infer/predict_system.py b/tools/infer/predict_system.py index ebfcd812..ba81aff0 100755 --- a/tools/infer/predict_system.py +++ b/tools/infer/predict_system.py @@ -188,7 +188,6 @@ def main(args): if __name__ == "__main__": args = utility.parse_args() if args.use_mp: - print("12233") p_list = [] total_process_num = args.total_process_num for process_id in range(total_process_num): From f5a119d2828865a116008554948fd7416a67330a Mon Sep 17 00:00:00 2001 From: tink2123 Date: Fri, 9 Apr 2021 23:24:54 +0800 Subject: [PATCH 7/9] add en doc for multi-lang --- doc/doc_en/multi_languages_en.md | 284 +++++++++++++++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 doc/doc_en/multi_languages_en.md diff --git a/doc/doc_en/multi_languages_en.md b/doc/doc_en/multi_languages_en.md new file mode 100644 index 00000000..ed849a1a --- /dev/null +++ b/doc/doc_en/multi_languages_en.md @@ -0,0 +1,284 @@ +# Multi-language model + +**Recent Update** + +-2021.4.9 supports the detection and recognition of 80 languages +-2021.4.9 supports **lightweight high-precision** English model detection and recognition + +-[1 Installation](#Install) + -[1.1 paddle installation](#paddleinstallation) + -[1.2 paddleocr package installation](#paddleocr_package_install) + +-[2 Quick Use](#Quick_Use) + -[2.1 Command line operation](#Command_line_operation) + -[2.1.1 Prediction of the whole image](#bash_detection+recognition) + -[2.1.2 Recognition and Prediction](#bash_Recognition) + -[2.1.3 Detection prediction](#bash_detection) + -[2.2 python script running](#python_Script_running) + -[2.2.1 Whole image prediction](#python_detection+recognition) + -[2.2.2 Recognition and Prediction](#python_Recognition) + -[2.2.3 Detection and prediction](#python_detection) +-[3 Custom Training](#Custom_Training) +-[4 Supported languages and abbreviations] (#language_abbreviations) + + +## 1 Installation + + +### 1.1 paddle installation +``` +# cpu +pip install paddlepaddle + +# gpu +pip instll paddlepaddle-gpu +``` + + +### 1.2 paddleocr package installation + + +pip install +``` +pip install "paddleocr>=2.0.4" # 2.0.4 version is recommended +``` +Build and install locally +``` +python3 setup.py bdist_wheel +pip3 install dist/paddleocr-x.x.x-py3-none-any.whl # x.x.x is the version number of paddleocr +``` + + +## 2 Quick use + + +### 2.1 Command line operation + +View help information + +``` +paddleocr -h +``` + +* Whole image prediction (detection + recognition) + +Paddleocr currently supports 80 languages, which can be switched by modifying the --lang parameter. The specific supported [language] (#语语abbreviation) can be viewed in the table. + +``` bash + +paddleocr --image_dir doc/imgs/japan_2.jpg --lang=japan +``` +![](https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.0/doc/imgs/japan_2.jpg) + +The result is a list, each item contains a text box, text and recognition confidence +```text +[[[671.0, 60.0], [847.0, 63.0], [847.0, 104.0], [671.0, 102.0]], ('もちもち', 0.9993342)] +[[[394.0, 82.0], [536.0, 77.0], [538.0, 127.0], [396.0, 132.0]], ('自然の', 0.9919842)] +[[[880.0, 89.0], [1014.0, 93.0], [1013.0, 127.0], [879.0, 124.0]], ('とろっと', 0.9976762)] +[[[1067.0, 101.0], [1294.0, 101.0], [1294.0, 138.0], [1067.0, 138.0]], ('后味のよい', 0.9988712)] +...... +``` + +* Identify predictions + +```bash +paddleocr --image_dir doc/imgs_words/japan/1.jpg --det false --lang=japan +``` + +![](https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.0/doc/imgs_words/japan/1.jpg) + +The result is a tuple, which returns the recognition result and recognition confidence + +```text +('したがって', 0.99965394) +``` + +* Detection and prediction + +``` +paddleocr --image_dir PaddleOCR/doc/imgs/11.jpg --rec false +``` + +The result is a list, each item contains only text boxes + +``` +[[26.0, 457.0], [137.0, 457.0], [137.0, 477.0], [26.0, 477.0]] +[[25.0, 425.0], [372.0, 425.0], [372.0, 448.0], [25.0, 448.0]] +[[128.0, 397.0], [273.0, 397.0], [273.0, 414.0], [128.0, 414.0]] +...... +``` + + +### 2.2 python script running + +ppocr also supports running in python scripts for easy embedding in your own code: + +* Whole image prediction (detection + recognition) + +``` +from paddleocr import PaddleOCR, draw_ocr + +# Also switch the language by modifying the lang parameter +ocr = PaddleOCR(lang="korean") # The model file will be downloaded automatically when executed for the first time +img_path ='doc/imgs/korean_1.jpg' +result = ocr.ocr(img_path) +# Print detection frame and recognition result +for line in result: + print(line) + +# Visualization +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='/path/to/PaddleOCR/doc/korean.ttf') +im_show = Image.fromarray(im_show) +im_show.save('result.jpg') +``` + +Visualization of results: +![](https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.0/doc/imgs_results/korean.jpg) + + +* Identify predictions + +``` +from paddleocr import PaddleOCR +ocr = PaddleOCR(lang="german") +img_path ='PaddleOCR/doc/imgs_words/german/1.jpg' +result = ocr.ocr(img_path, det=False, cls=True) +for line in result: + print(line) +``` + +![](https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.0/doc/imgs_words/german/1.jpg) + +The result is a tuple, which only contains the recognition result and recognition confidence + +``` +('leider auch jetzt', 0.97538936) +``` + +* Detection and prediction + +```python +from paddleocr import PaddleOCR, draw_ocr +ocr = PaddleOCR() # need to run only once to download and load model into memory +img_path ='PaddleOCR/doc/imgs_en/img_12.jpg' +result = ocr.ocr(img_path, rec=False) +for line in result: + print(line) + +# show result +from PIL import Image + +image = Image.open(img_path).convert('RGB') +im_show = draw_ocr(image, result, txts=None, scores=None, font_path='/path/to/PaddleOCR/doc/fonts/simfang.ttf') +im_show = Image.fromarray(im_show) +im_show.save('result.jpg') +``` +The result is a list, each item contains only text boxes +```bash +[[26.0, 457.0], [137.0, 457.0], [137.0, 477.0], [26.0, 477.0]] +[[25.0, 425.0], [372.0, 425.0], [372.0, 448.0], [25.0, 448.0]] +[[128.0, 397.0], [273.0, 397.0], [273.0, 414.0], [128.0, 414.0]] +...... +``` + +Visualization of results: +![](https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.0/doc/imgs_results/whl/12_det.jpg) + +ppocr also supports direction classification. For more usage methods, please refer to: [whl package instructions](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.0/doc/doc_ch/whl.md). + + +## 3 Custom training + +ppocr supports using your own data for custom training or finetune, where the recognition model can refer to [French configuration file](../../configs/rec/multi_language/rec_french_lite_train.yml) +Modify the training data path, dictionary and other parameters. + +For specific data preparation and training process, please refer to: [Text Detection](../doc_ch/detection.md), [Text Recognition](../doc_ch/recognition.md), more functions such as predictive deployment, +For functions such as data annotation, you can read the complete [Document Tutorial](../../README_ch.md). + + +## 4 Support languages and abbreviations + +| Language | Abbreviation | +| --- | --- | +|chinese and english|ch| +|english|en| +|french|fr| +|german|german| +|japan|japan| +|korean|korean| +|chinese traditional |ch_tra| +| Italian |it| +|Spanish |es| +| Portuguese|pt| +|Russia|ru| +|Arabic|ar| +|Hindi|hi| +|Uyghur|ug| +|Persian|fa| +|Urdu|ur| +| Serbian(latin) |rs_latin| +|Occitan |oc| +|Marathi|mr| +|Nepali|ne| +|Serbian(cyrillic)|rs_cyrillic| +|Bulgarian |bg| +|Ukranian|uk| +|Belarusian|be| +|Telugu |te| +|Kannada |kn| +|Tamil |ta| +|Afrikaans |af| +|Azerbaijani |az| +|Bosnian|bs| +|Czech|cs| +|Welsh |cy| +|Danish|da| +|Estonian |et| +|Irish |ga| +|Croatian |hr| +|Hungarian |hu| +|Indonesian|id| +|Icelandic|is| +|Kurdish|ku| +|Lithuanian |lt| + |Latvian |lv| +|Maori|mi| +|Malay|ms| +|Maltese |mt| +|Dutch |nl| +|Norwegian |no| +|Polish |pl| +|Romanian |ro| +|Slovak |sk| +|Slovenian |sl| +|Albanian |sq| +|Swedish |sv| +|Swahili |sw| +|Tagalog |tl| +|Turkish |tr| +|Uzbek |uz| +|Vietnamese |vi| +|Mongolian |mn| +|Abaza |abq| +|Adyghe |ady| +|Kabardian |kbd| +|Avar |ava| +|Dargwa |dar| +|Ingush |inh| +|Lak |lbe| +|Lezghian |lez| +|Tabassaran |tab| +|Bihari |bh| +|Maithili |mai| +|Angika |ang| +|Bhojpuri |bho| +|Magahi |mah| +|Nagpur |sck| +|Newari |new| +|Goan Konkani|gom| +|Saudi Arabia|sa| From 6b2f749739f52abd9a5fc54815d0984c8b31ebbb Mon Sep 17 00:00:00 2001 From: tink2123 Date: Fri, 9 Apr 2021 23:32:50 +0800 Subject: [PATCH 8/9] add en doc for multi-lang --- doc/doc_en/multi_languages_en.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/doc_en/multi_languages_en.md b/doc/doc_en/multi_languages_en.md index ed849a1a..f6a3a82c 100644 --- a/doc/doc_en/multi_languages_en.md +++ b/doc/doc_en/multi_languages_en.md @@ -12,14 +12,14 @@ -[2 Quick Use](#Quick_Use) -[2.1 Command line operation](#Command_line_operation) -[2.1.1 Prediction of the whole image](#bash_detection+recognition) - -[2.1.2 Recognition and Prediction](#bash_Recognition) - -[2.1.3 Detection prediction](#bash_detection) + -[2.1.2 Recognition](#bash_Recognition) + -[2.1.3 Detection](#bash_detection) -[2.2 python script running](#python_Script_running) -[2.2.1 Whole image prediction](#python_detection+recognition) - -[2.2.2 Recognition and Prediction](#python_Recognition) - -[2.2.3 Detection and prediction](#python_detection) + -[2.2.2 Recognition](#python_Recognition) + -[2.2.3 Detection](#python_detection) -[3 Custom Training](#Custom_Training) --[4 Supported languages and abbreviations] (#language_abbreviations) +-[4 Supported languages and abbreviations](#language_abbreviations) ## 1 Installation @@ -62,7 +62,8 @@ paddleocr -h * Whole image prediction (detection + recognition) -Paddleocr currently supports 80 languages, which can be switched by modifying the --lang parameter. The specific supported [language] (#语语abbreviation) can be viewed in the table. +Paddleocr currently supports 80 languages, which can be switched by modifying the --lang parameter. +The specific supported [language] (#language_abbreviations) can be viewed in the table. ``` bash @@ -79,7 +80,7 @@ The result is a list, each item contains a text box, text and recognition confid ...... ``` -* Identify predictions +* Recognition ```bash paddleocr --image_dir doc/imgs_words/japan/1.jpg --det false --lang=japan @@ -93,7 +94,7 @@ The result is a tuple, which returns the recognition result and recognition conf ('したがって', 0.99965394) ``` -* Detection and prediction +* Detection ``` paddleocr --image_dir PaddleOCR/doc/imgs/11.jpg --rec false @@ -141,7 +142,7 @@ Visualization of results: ![](https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.0/doc/imgs_results/korean.jpg) -* Identify predictions +* Recognition ``` from paddleocr import PaddleOCR @@ -160,7 +161,7 @@ The result is a tuple, which only contains the recognition result and recognitio ('leider auch jetzt', 0.97538936) ``` -* Detection and prediction +* Detection ```python from paddleocr import PaddleOCR, draw_ocr From 839bb4281a4aa400393d52d683ee194418204d97 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Fri, 9 Apr 2021 23:34:02 +0800 Subject: [PATCH 9/9] add en doc for multi-lang --- doc/doc_en/multi_languages_en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/doc_en/multi_languages_en.md b/doc/doc_en/multi_languages_en.md index f6a3a82c..d1c4583f 100644 --- a/doc/doc_en/multi_languages_en.md +++ b/doc/doc_en/multi_languages_en.md @@ -198,8 +198,8 @@ ppocr also supports direction classification. For more usage methods, please ref ppocr supports using your own data for custom training or finetune, where the recognition model can refer to [French configuration file](../../configs/rec/multi_language/rec_french_lite_train.yml) Modify the training data path, dictionary and other parameters. -For specific data preparation and training process, please refer to: [Text Detection](../doc_ch/detection.md), [Text Recognition](../doc_ch/recognition.md), more functions such as predictive deployment, -For functions such as data annotation, you can read the complete [Document Tutorial](../../README_ch.md). +For specific data preparation and training process, please refer to: [Text Detection](../doc_en/detection_en.md), [Text Recognition](../doc_en/recognition_en.md), more functions such as predictive deployment, +For functions such as data annotation, you can read the complete [Document Tutorial](../../README.md). ## 4 Support languages and abbreviations