优化命名,类与模块最好不要重名

This commit is contained in:
2024-09-20 14:32:31 +08:00
parent 7b6e78373c
commit f0c03e763b
9 changed files with 50 additions and 32 deletions

View File

@@ -11,7 +11,7 @@ from paddlenlp.utils.doc_parser import DocParser
from paddleocr import PaddleOCR
from ucloud import ufile
from util import image_util, util
from util import image_util, common_util
def write_visual_result(image, angle=0, layout=None, result=None):
@@ -63,7 +63,7 @@ def visual_model_test(model_type, test_img, task_path, schema):
img["y_offset"] -= offset_y
temp_files_paths.append(temp_file.name)
parsed_doc = util.get_ocr_layout(
parsed_doc = common_util.get_ocr_layout(
PaddleOCR(det_db_box_thresh=0.3, det_db_thresh=0.1, det_limit_side_len=1248, drop_score=0.3,
save_crop_res=False),
temp_file.name)
@@ -121,7 +121,8 @@ def main(model_type, pic_name=None):
if model_type == "ocr":
task_path = None
test_img_path = ufile.get_private_url(pic_name, "drg103") if pic_name else "../test_img/PH20240725004467_3_185708_1.jpg"
test_img_path = ufile.get_private_url(pic_name,
"drg103") if pic_name else "../test_img/PH20240725004467_3_185708_1.jpg"
schema = None
elif model_type == "settlement":
task_path = "../model/settlement_list_model"