调整ocr识别的最大长度为1248,过大的长度也可能导致识别错误

This commit is contained in:
2024-07-25 09:51:52 +08:00
parent 6e7e711b16
commit 162aea0ebb
2 changed files with 2 additions and 2 deletions

View File

@@ -29,4 +29,4 @@ SIMILAR_CHAR = {
}
# 如果不希望识别出空格可以设置use_space_char=False。做此项设置一定要测试2.7.3版本此项设置有bug会导致识别失败
OCR = PaddleOCR(use_angle_cls=False, show_log=False, det_db_box_thresh=0.3, det_limit_side_len=2048)
OCR = PaddleOCR(use_angle_cls=False, show_log=False, det_db_box_thresh=0.3, det_limit_side_len=1248)

View File

@@ -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(PaddleOCR(det_db_box_thresh=0.3, det_limit_side_len=2048),
parsed_doc = util.get_ocr_layout(PaddleOCR(det_db_box_thresh=0.3, det_limit_side_len=1248),
temp_file.name)
# parsed_doc = doc_parser.parse({"doc": temp_file.name})["layout"]
if img["x_offset"] or img["y_offset"]: