From 448edfedc9f8ea9e9bbe772155b6527756f1fd28 Mon Sep 17 00:00:00 2001 From: Wang Xin Date: Thu, 29 Aug 2024 12:00:56 +0800 Subject: [PATCH] Solve ModuleNotFoundError: No module named 'tools.infer' (#13348) (#13603) * add layout score return * fix(paddleocr): correct import path for predict_system to fix ModuleNotFoundError: No module named 'tools.infer' * fix(paddleocr): move from tools.infer import predict_system under "tools" define to slove ModuleNotFoundError: No module named 'tools.infer' Co-authored-by: myhloli --- paddleocr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddleocr.py b/paddleocr.py index 028d855c99..6ab64bc1e8 100644 --- a/paddleocr.py +++ b/paddleocr.py @@ -32,7 +32,6 @@ from io import BytesIO import pprint from PIL import Image -from tools.infer import predict_system def _import_file(module_name, file_path, make_importable=False): @@ -63,6 +62,7 @@ def _import_file(module_name, file_path, make_importable=False): is_link, confirm_model_dir_url, ) +from tools.infer import predict_system from tools.infer.utility import draw_ocr, str2bool, check_gpu from ppstructure.utility import init_args, draw_structure_result from ppstructure.predict_system import StructureSystem, save_structure_res, to_excel