refactor ocr and table recognition logic#80
Merged
myhloli merged 4 commits intoopendatalab:xiaomeng_devfrom Aug 8, 2024
Merged
refactor ocr and table recognition logic#80myhloli merged 4 commits intoopendatalab:xiaomeng_devfrom
myhloli merged 4 commits intoopendatalab:xiaomeng_devfrom
Conversation
Collaborator
myhloli
commented
Aug 8, 2024
- refactor(pdf_extract): optimize image processing and table recognition
- fix(pdf_extract): optimize batch size and worker count for DataLoader
- feat(self_modify): refine text and formula detection box updating logic
- refactor(extract_pdf): When converting a PDF to a list of images, do not perform a BGR channel conversion upfront.
…not perform a BGR channel conversion upfront.
Update the logic for merging and refining detection boxes in self_modify module. Replace hardcoded checks with dynamic calculations for determining overlapping regions, resulting in more accurate detection box merging when formulae are identified within texts.
Reduce the batch size from 128 to 64 and set the number of workers to 0 in the DataLoaderto improve stability and performance on systems with limited resources. refactor(pdf_extract): refactor ocr and table recognition logicRefactor the ocr and table recognition logic to enhance readability and maintainability.This includes the adjustment of formula recognition coordinates relative to the cropped image and streamlining the process for handling OCR results and table recognition.
- Rename loop variable 'idx' to 'pdf_idx' for clarity.- Adjust image pasting and coordinate handling during OCR processing.- Add comments for improved code understanding.- Ensure proper rendering of images during PDF visualization. - Refactor logging and utility imports in self_modify module. The changes include improvements to image processing routines, better variable naming, and streamlined table recognition logic. Also, the visualization process has been tweaked to handle images more accurately. Additionally, redundant logging and utility importshave been cleaned up in the self_modify module to declutter the codebase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.