From 5d27610e52eb738e42ac117a847abb27253b7766 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Wed, 14 Apr 2021 15:38:27 +0800 Subject: [PATCH] fix some typo --- .../multi_language/generate_multi_language_configs.py | 1 - doc/doc_ch/multi_languages.md | 9 ++++----- doc/doc_en/multi_languages_en.md | 5 ++--- paddleocr.py | 1 + ppocr/data/imaug/label_ops.py | 2 +- ppocr/postprocess/rec_postprocess.py | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/configs/rec/multi_language/generate_multi_language_configs.py b/configs/rec/multi_language/generate_multi_language_configs.py index c3e33c0e..6759ca2a 100644 --- a/configs/rec/multi_language/generate_multi_language_configs.py +++ b/configs/rec/multi_language/generate_multi_language_configs.py @@ -118,7 +118,6 @@ class ArgsParser(ArgumentParser): return config def _set_language(self, type): - print("type:", type) lang = type[0] assert (type), "please use -l or --language to choose language type" assert( diff --git a/doc/doc_ch/multi_languages.md b/doc/doc_ch/multi_languages.md index 6a078f3c..5095615d 100755 --- a/doc/doc_ch/multi_languages.md +++ b/doc/doc_ch/multi_languages.md @@ -134,7 +134,7 @@ paddleocr --image_dir PaddleOCR/doc/imgs/11.jpg --rec false ### 2.2 python 脚本运行 -ppocr 也支持在python脚本中运行,便于嵌入到您自己的代码中: +ppocr 也支持在python脚本中运行,便于嵌入到您自己的代码中 : * 整图预测(检测+识别) @@ -155,7 +155,7 @@ 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 = draw_ocr(image, boxes, txts, scores, font_path='/path/to/PaddleOCR/doc/fonts/korean.ttf') im_show = Image.fromarray(im_show) im_show.save('result.jpg') ``` @@ -240,7 +240,7 @@ ppocr 支持使用自己的数据进行自定义训练或finetune, 其中识别 |德文|german|german| |日文|japan|japan| |韩文|korean|korean| -|中文繁体|chinese traditional |ch_tra| +|中文繁体|chinese traditional |chinese_cht| |意大利文| Italian |it| |西班牙文|Spanish |es| |葡萄牙文| Portuguese|pt| @@ -259,10 +259,9 @@ ppocr 支持使用自己的数据进行自定义训练或finetune, 其中识别 |乌克兰文|Ukranian|uk| |白俄罗斯文|Belarusian|be| |泰卢固文|Telugu |te| -|卡纳达文|Kannada |kn| |泰米尔文|Tamil |ta| |南非荷兰文 |Afrikaans |af| -|阿塞拜疆文 |Azerbaijani |az| +|阿塞拜疆文 |Azerbaijani |az| |波斯尼亚文|Bosnian|bs| |捷克文|Czech|cs| |威尔士文 |Welsh |cy| diff --git a/doc/doc_en/multi_languages_en.md b/doc/doc_en/multi_languages_en.md index 65f8bccd..6f8384f3 100755 --- a/doc/doc_en/multi_languages_en.md +++ b/doc/doc_en/multi_languages_en.md @@ -153,7 +153,7 @@ 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 = draw_ocr(image, boxes, txts, scores, font_path='/path/to/PaddleOCR/doc/fonts/korean.ttf') im_show = Image.fromarray(im_show) im_show.save('result.jpg') ``` @@ -232,7 +232,7 @@ For functions such as data annotation, you can read the complete [Document Tutor |german|german| |japan|japan| |korean|korean| -|chinese traditional |ch_tra| +|chinese traditional |chinese_cht| | Italian |it| |Spanish |es| | Portuguese|pt| @@ -251,7 +251,6 @@ For functions such as data annotation, you can read the complete [Document Tutor |Ukranian|uk| |Belarusian|be| |Telugu |te| -|Kannada |kn| |Tamil |ta| |Afrikaans |af| |Azerbaijani |az| diff --git a/paddleocr.py b/paddleocr.py index 67ce202c..016b00c1 100644 --- a/paddleocr.py +++ b/paddleocr.py @@ -30,6 +30,7 @@ from ppocr.utils.logging import get_logger logger = get_logger() from ppocr.utils.utility import check_and_read_gif, get_image_file_list +from tools.infer.utility import draw_ocr __all__ = ['PaddleOCR'] diff --git a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py index cbb11009..ed1b35e8 100644 --- a/ppocr/data/imaug/label_ops.py +++ b/ppocr/data/imaug/label_ops.py @@ -96,7 +96,7 @@ class BaseRecLabelEncode(object): 'ch', 'en', 'EN_symbol', 'french', 'german', 'japan', 'korean', 'EN', 'it', 'xi', 'pu', 'ru', 'ar', 'ta', 'ug', 'fa', 'ur', 'rs', 'oc', 'rsc', 'bg', 'uk', 'be', 'te', 'ka', 'chinese_cht', 'hi', - 'mr', 'ne' + 'mr', 'ne', 'latin', 'arabic', 'cyrillic', 'devanagari' ] assert character_type in support_character_type, "Only {} are supported now but get {}".format( support_character_type, character_type) diff --git a/ppocr/postprocess/rec_postprocess.py b/ppocr/postprocess/rec_postprocess.py index af243caa..e6bc07aa 100644 --- a/ppocr/postprocess/rec_postprocess.py +++ b/ppocr/postprocess/rec_postprocess.py @@ -28,7 +28,7 @@ class BaseRecLabelDecode(object): 'ch', 'en', 'EN_symbol', 'french', 'german', 'japan', 'korean', 'it', 'xi', 'pu', 'ru', 'ar', 'ta', 'ug', 'fa', 'ur', 'rs', 'oc', 'rsc', 'bg', 'uk', 'be', 'te', 'ka', 'chinese_cht', 'hi', 'mr', - 'ne', 'EN' + 'ne', 'EN', 'latin', 'arabic', 'cyrillic', 'devanagari' ] assert character_type in support_character_type, "Only {} are supported now but get {}".format( support_character_type, character_type) -- GitLab