diff --git a/MANIFEST.in b/MANIFEST.in index 1fcf184dacee9dcaf3d5b2e62d12c7b156e068c7..f821618ab5e14b755539ce64c14c1862cecc5552 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,7 @@ include LICENSE include README.md -recursive-include ppocr/utils *.txt utility.py logging.py network.py +recursive-include ppocr/utils *.* recursive-include ppocr/data *.py recursive-include ppocr/postprocess *.py recursive-include tools/infer *.py diff --git a/doc/doc_ch/whl.md b/doc/doc_ch/whl.md index 3b88709a2328409a266d0d482baa072dd7aa3824..2d524b83d73d4951939c7e0f108c494ab79a86c6 100644 --- a/doc/doc_ch/whl.md +++ b/doc/doc_ch/whl.md @@ -418,7 +418,7 @@ im_show.save('result.jpg') | det | 前向时使用启动检测 | TRUE | | rec | 前向时是否启动识别 | TRUE | | cls | 前向时是否启动分类 (命令行模式下使用use_angle_cls控制前向是否启动分类) | FALSE | -| show_log | 是否打印det和rec等信息 | FALSE | +| show_log | 是否打印logger信息 | FALSE | | type | 执行ocr或者表格结构化, 值可选['ocr','structure'] | ocr | | ocr_version | OCR模型版本,可选PP-OCRv2, PP-OCR。PP-OCRv2 目前仅支持中文的检测和识别模型,PP-OCR支持中文的检测,识别,多语种识别,方向分类器等模型 | PP-OCRv2 | | structure_version | 表格结构化模型版本,可选 STRUCTURE。STRUCTURE支持表格结构化模型 | STRUCTURE | diff --git a/doc/doc_en/whl_en.md b/doc/doc_en/whl_en.md index 62aa452dcd36906c6480031375e6ca94f8a36de3..2671fbb9f0b5653cff29908a0c40d14a25b2cc58 100644 --- a/doc/doc_en/whl_en.md +++ b/doc/doc_en/whl_en.md @@ -365,7 +365,7 @@ im_show.save('result.jpg') | det | Enable detction when `ppocr.ocr` func exec | TRUE | | rec | Enable recognition when `ppocr.ocr` func exec | TRUE | | cls | Enable classification when `ppocr.ocr` func exec((Use use_angle_cls in command line mode to control whether to start classification in the forward direction) | FALSE | -| show_log | Whether to print log in det and rec | FALSE | +| show_log | Whether to print log| FALSE | | type | Perform ocr or table structuring, the value is selected in ['ocr','structure'] | ocr | | ocr_version | OCR Model version number, the current model support list is as follows: PP-OCRv2 support Chinese detection and recognition model, PP-OCR support Chinese detection, recognition and direction classifier, multilingual recognition model | PP-OCRv2 | | structure_version | table structure Model version number, the current model support list is as follows: STRUCTURE support english table structure model | STRUCTURE | diff --git a/paddleocr.py b/paddleocr.py index f0938c6740606bdb2a96a6f9836602c0fb670650..c550fc5e26a0bf0a9603663ec1e9f32e3ce29381 100644 --- a/paddleocr.py +++ b/paddleocr.py @@ -42,7 +42,7 @@ __all__ = [ ] SUPPORT_DET_MODEL = ['DB'] -VERSION = '2.4' +VERSION = '2.4.0.2' SUPPORT_REC_MODEL = ['CRNN'] BASE_DIR = os.path.expanduser("~/.paddleocr/") @@ -308,20 +308,18 @@ class PaddleOCR(predict_system.TextSystem): 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), + os.path.join(BASE_DIR, 'whl', 'det', det_lang), det_model_config['url']) rec_model_config = get_model_config('OCR', params.ocr_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']) + os.path.join(BASE_DIR, 'whl', 'rec', lang), rec_model_config['url']) cls_model_config = get_model_config('OCR', params.ocr_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']) + os.path.join(BASE_DIR, 'whl', 'cls'), cls_model_config['url']) # download model maybe_download(params.det_model_dir, det_url) maybe_download(params.rec_model_dir, rec_url) @@ -338,7 +336,7 @@ class PaddleOCR(predict_system.TextSystem): params.rec_char_dict_path = str( Path(__file__).parent / rec_model_config['dict_path']) - print(params) + logger.debug(params) # init det_model and rec_model super().__init__(params) @@ -412,20 +410,18 @@ class PPStructure(OCRSystem): 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), + os.path.join(BASE_DIR, 'whl', 'det', det_lang), det_model_config['url']) rec_model_config = get_model_config('OCR', params.ocr_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']) + os.path.join(BASE_DIR, 'whl', 'rec', lang), rec_model_config['url']) table_model_config = get_model_config( 'STRUCTURE', params.structure_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']) + os.path.join(BASE_DIR, 'whl', 'table'), table_model_config['url']) # download model maybe_download(params.det_model_dir, det_url) maybe_download(params.rec_model_dir, rec_url) @@ -438,7 +434,7 @@ class PPStructure(OCRSystem): params.table_char_dict_path = str( Path(__file__).parent / table_model_config['dict_path']) - print(params) + logger.debug(params) super().__init__(params) def __call__(self, img): diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 25939b0ebc39314583a45b4375d947f19a826d17..80abba67b293e3412afa6c1ea8da0291331ef8de 100644 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -622,7 +622,6 @@ def get_rotate_crop_image(img, points): def check_gpu(use_gpu): if use_gpu and not paddle.is_compiled_with_cuda(): - use_gpu = False return use_gpu