Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图片描述 #1310

Open
lyc728 opened this issue Dec 17, 2024 · 5 comments
Open

图片描述 #1310

lyc728 opened this issue Dec 17, 2024 · 5 comments

Comments

@lyc728
Copy link

lyc728 commented Dec 17, 2024

现在图片描述每次都在图片下面 我想还原pdf原本目录 这块代码在什么地方可以修改呢?感谢

@myhloli
Copy link
Collaborator

myhloli commented Dec 17, 2024

for block in para_block['blocks']: # 1st.拼image_body

@lyc728
Copy link
Author

lyc728 commented Dec 17, 2024

这里应该先排序,再把对应的if条件写进去对吧

企业微信截图_17344376725308

@lyc728
Copy link
Author

lyc728 commented Dec 17, 2024

para_block['blocks']= sorted(para_block['blocks'], key=lambda block: block['bbox'][1]) for block in para_block['blocks']: # 1st.拼image_body if block['type'] == BlockType.ImageCaption: para_text += merge_para_with_text(block) + ' \n' if block['type'] == BlockType.ImageBody: for line in block['lines']: for span in line['spans']: if span['type'] == ContentType.Image: if span.get('image_path', ''):

@myhloli
Copy link
Collaborator

myhloli commented Dec 17, 2024

不用排序,你就调一下拼接的先后顺序就行

@lyc728
Copy link
Author

lyc728 commented Dec 18, 2024

需要排序吧 我看到前面处理总是把图片放在前面的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants