|
@@ -8,9 +8,14 @@ from PIL import Image
|
|
|
from typing import Dict, List
|
|
from typing import Dict, List
|
|
|
|
|
|
|
|
from .config_loader import load_structure_from_config, build_data_source_catalog
|
|
from .config_loader import load_structure_from_config, build_data_source_catalog
|
|
|
-from .data_processor import parse_ocr_data, get_structure_from_ocr
|
|
|
|
|
|
|
+from .data_processor import get_structure_from_ocr
|
|
|
from .drawing import clear_table_image_cache
|
|
from .drawing import clear_table_image_cache
|
|
|
|
|
|
|
|
|
|
+try:
|
|
|
|
|
+ from table_line_generator import TableLineGenerator
|
|
|
|
|
+except ImportError:
|
|
|
|
|
+ from ..table_line_generator import TableLineGenerator
|
|
|
|
|
+
|
|
|
|
|
|
|
|
def create_directory_selector(
|
|
def create_directory_selector(
|
|
|
data_sources: List[Dict],
|
|
data_sources: List[Dict],
|
|
@@ -142,7 +147,7 @@ def _load_catalog_entry(
|
|
|
raw = json.load(fp)
|
|
raw = json.load(fp)
|
|
|
|
|
|
|
|
# 🔑 根据工具类型解析数据
|
|
# 🔑 根据工具类型解析数据
|
|
|
- table_bbox, ocr_data = parse_ocr_data(raw, tool)
|
|
|
|
|
|
|
+ table_bbox, ocr_data = TableLineGenerator.parse_ocr_data(raw, tool=tool)
|
|
|
|
|
|
|
|
st.session_state.ocr_data = ocr_data
|
|
st.session_state.ocr_data = ocr_data
|
|
|
st.session_state.table_bbox = table_bbox
|
|
st.session_state.table_bbox = table_bbox
|