Skip to content

Commit

Permalink
Merge pull request #769 from myhloli/add-doclayout-yolo
Browse files Browse the repository at this point in the history
update:update config json
  • Loading branch information
myhloli authored Oct 23, 2024
2 parents d18a55e + 790691d commit efb5851
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions magic-pdf.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@
"models-dir":"/tmp/models",
"layoutreader-model-dir":"/tmp/layoutreader",
"device-mode":"cpu",
"layout-config": {
"model": "doclayout_yolo"
},
"formula-config": {
"mfd_model": "yolo_v8_mfd",
"mfr_model": "unimernet_small",
"enable": true
},
"table-config": {
"model": "TableMaster",
"is_table_recog_enable": false,
"model": "tablemaster",
"enable": false,
"max_time": 400
}
},
"config_version": "1.0.0"
}
2 changes: 1 addition & 1 deletion magic_pdf/dict2md/ocr_mkcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def merge_para_with_text(para_block):
def para_to_standard_format_v2(para_block, img_buket_path, page_idx, drop_reason=None):
para_type = para_block['type']
para_content = {}
if para_type == BlockType.Text:
if para_type in [BlockType.Text, BlockType.List, BlockType.Index]:
para_content = {
'type': 'text',
'text': merge_para_with_text(para_block),
Expand Down

0 comments on commit efb5851

Please sign in to comment.