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

Feat/remove reference of PageLayout.elements #3943

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

badGarnet
Copy link
Collaborator

@badGarnet badGarnet commented Mar 5, 2025

This PR removes usage of PageLayout.elements from partition function, except for when analysis=True. This PR updates the partition logic so that PageLayout.elements_array is used everywhere to save memory and cpu cost.
Since the analysis function is intended for investigation and not for general document processing purposes, this part of the code is left for a future refactor.

PageLayout.elements uses a list to store layout elements' data while elements_array uses numpy array to store the data, which has much lower memory requirements. Using memory_profiler to test the differences is usually around 10x.

@badGarnet badGarnet changed the title Feat/remove reference of pagelayout elements Feat/remove reference of PageLayout.elements Mar 6, 2025
@badGarnet badGarnet marked this pull request as ready for review March 6, 2025 16:35
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

Successfully merging this pull request may close these issues.

1 participant