|
@@ -8,6 +8,7 @@ from io import BytesIO
|
|
|
import json
|
|
import json
|
|
|
from pathlib import Path
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
+from ocr_validator_utils import process_all_images_in_content
|
|
|
|
|
|
|
|
def display_single_page_cross_validation(validator, config):
|
|
def display_single_page_cross_validation(validator, config):
|
|
|
"""显示单页交叉验证结果
|
|
"""显示单页交叉验证结果
|
|
@@ -63,7 +64,8 @@ def _display_valid_cross_validation_result(validator, config, current_md_path, v
|
|
|
if current_md_path.exists():
|
|
if current_md_path.exists():
|
|
|
with open(current_md_path, "r", encoding="utf-8") as f:
|
|
with open(current_md_path, "r", encoding="utf-8") as f:
|
|
|
original_md_content = f.read()
|
|
original_md_content = f.read()
|
|
|
-
|
|
|
|
|
|
|
+ original_md_content = process_all_images_in_content(original_md_content, current_md_path)
|
|
|
|
|
+
|
|
|
font_size = config['styles'].get('font_size', 10)
|
|
font_size = config['styles'].get('font_size', 10)
|
|
|
height = config['styles']['layout'].get('default_height', 800)
|
|
height = config['styles']['layout'].get('default_height', 800)
|
|
|
validator.layout_manager.render_content_by_mode(
|
|
validator.layout_manager.render_content_by_mode(
|
|
@@ -78,6 +80,7 @@ def _display_valid_cross_validation_result(validator, config, current_md_path, v
|
|
|
if verify_md_path and verify_md_path.exists():
|
|
if verify_md_path and verify_md_path.exists():
|
|
|
with open(str(verify_md_path), "r", encoding="utf-8") as f:
|
|
with open(str(verify_md_path), "r", encoding="utf-8") as f:
|
|
|
verify_md_content = f.read()
|
|
verify_md_content = f.read()
|
|
|
|
|
+ verify_md_content = process_all_images_in_content(verify_md_content, verify_md_path)
|
|
|
|
|
|
|
|
font_size = config['styles'].get('font_size', 10)
|
|
font_size = config['styles'].get('font_size', 10)
|
|
|
height = config['styles']['layout'].get('default_height', 800)
|
|
height = config['styles']['layout'].get('default_height', 800)
|