Commit 5513a575 authored by zhougaofeng's avatar zhougaofeng
Browse files

Update common.py

parent ba10e53c
......@@ -48,7 +48,7 @@ def do_parse(
model_list,
parse_method,
debug_able,
model,
f_draw_span_bbox=True,
f_draw_layout_bbox=True,
f_dump_md=True,
......@@ -61,6 +61,7 @@ def do_parse(
start_page_id=0,
end_page_id=None,
):
if debug_able:
logger.warning('debug mode is on')
......@@ -76,13 +77,13 @@ def do_parse(
image_dir = str(os.path.basename(local_image_dir))
if parse_method == 'auto':
jso_useful_key = {'_pdf_type': '', 'model_list': model_list}
pipe = UNIPipe(pdf_bytes, jso_useful_key, image_writer, is_debug=True,
pipe = UNIPipe(pdf_bytes, jso_useful_key, image_writer, is_debug=False,
start_page_id=start_page_id, end_page_id=end_page_id)
elif parse_method == 'txt':
pipe = TXTPipe(pdf_bytes, model_list, image_writer, is_debug=True,
pipe = TXTPipe(pdf_bytes, model_list, image_writer, is_debug=False,
start_page_id=start_page_id, end_page_id=end_page_id)
elif parse_method == 'ocr':
pipe = OCRPipe(pdf_bytes, model_list, image_writer, is_debug=True,
pipe = OCRPipe(pdf_bytes, model_list, image_writer, is_debug=False,
start_page_id=start_page_id, end_page_id=end_page_id)
else:
logger.error('unknown parse method')
......@@ -93,7 +94,7 @@ def do_parse(
if len(model_list) == 0:
if model_config.__use_inside_model__:
pipe.pipe_analyze()
pipe.pipe_analyze(model)
orig_model_list = copy.deepcopy(pipe.model_list)
else:
logger.error('need model list input')
......
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