Commit bd2c3d12 authored by myhloli's avatar myhloli
Browse files

refactor: update OCR handling and adjust root directory path for model loading

parent 38ace5dc
......@@ -101,7 +101,7 @@ def doc_analyze(
elif parse_method == 'ocr':
_ocr = True
ocr_enabled_list[pdf_idx] = _ocr
ocr_enabled_list.append(_ocr)
_lang = lang_list[pdf_idx]
# 收集每个数据集中的页面
......
......@@ -8,7 +8,7 @@ from rapid_table import RapidTable, RapidTableInput
class RapidTableModel(object):
def __init__(self, ocr_engine):
root_dir = Path(__file__).absolute().parent.parent.parent.parent.parent
root_dir = Path(__file__).absolute().parent.parent.parent
slanet_plus_model_path = os.path.join(root_dir, 'resources', 'slanet_plus', 'slanet-plus.onnx')
input_args = RapidTableInput(model_type='slanet_plus', model_path=slanet_plus_model_path)
self.table_model = RapidTable(input_args)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment