From f85b3ea8ebdb4292d3490f7d18b8019ba93b6787 Mon Sep 17 00:00:00 2001 From: WenmuZhou <572459439@qq.com> Date: Fri, 18 Mar 2022 10:08:58 +0000 Subject: [PATCH] fix bug in whl import fce --- MANIFEST.in | 2 +- paddleocr.py | 20 ++++++++------------ tools/infer/utility.py | 1 - 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 1fcf184d..f821618a 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/paddleocr.py b/paddleocr.py index b3776ec2..c550fc5e 100644 --- a/paddleocr.py +++ b/paddleocr.py @@ -42,7 +42,7 @@ __all__ = [ ] SUPPORT_DET_MODEL = ['DB'] -VERSION = '2.4.0.1' +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) @@ -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) @@ -499,4 +495,4 @@ def main(): for item in result: item.pop('img') - logger.info(item) \ No newline at end of file + logger.info(item) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 25939b0e..80abba67 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 -- GitLab