Commit 0135861f authored by zhougaofeng's avatar zhougaofeng
Browse files

Update doc_analyze_by_custom_model.py

parent 554e45af
...@@ -127,14 +127,14 @@ def doc_analyze(pdf_bytes: bytes, ocr: bool = False, show_log: bool = False, ...@@ -127,14 +127,14 @@ def doc_analyze(pdf_bytes: bytes, ocr: bool = False, show_log: bool = False,
page_width = img_dict["width"] page_width = img_dict["width"]
page_height = img_dict["height"] page_height = img_dict["height"]
if start_page_id <= index <= end_page_id: if start_page_id <= index <= end_page_id:
result = custom_model(img) result = custom_model(img,index,end_page_id)
else: else:
result = [] result = []
page_info = {"page_no": index, "height": page_height, "width": page_width} page_info = {"page_no": index, "height": page_height, "width": page_width}
page_dict = {"layout_dets": result, "page_info": page_info} page_dict = {"layout_dets": result, "page_info": page_info}
model_json.append(page_dict) model_json.append(page_dict)
doc_analyze_cost = time.time() - doc_analyze_start doc_analyze_cost = time.time() - doc_analyze_start
logger.info(f"doc analyze cost: {doc_analyze_cost}") logger.info(f"文件分析提取截图共耗时: {doc_analyze_cost}")
# logger.info(f'model_json:\n{model_json}') # logger.info(f'model_json:\n{model_json}')
return model_json return model_json
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