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

Vertical block separation #1512

Open
snewman-aa opened this issue Mar 13, 2024 · 0 comments
Open

Vertical block separation #1512

snewman-aa opened this issue Mar 13, 2024 · 0 comments
Labels

Comments

@snewman-aa
Copy link

🚀 The feature

Currently, builder.py has a paragraph_break parameter for merging sub_lines that are relatively close enough.

I would appreciate a similar parameter for merging stacked lines that are vertically close enough.

Motivation, pitch

Screenshot 2024-03-13 at 2 01 24 PM

Currently, when I run docTR on the above image and images with similar lower thirds, I get the following from result.render() with the \n\n representing separating different blocks. I would like to be able to direct the builder to merge lines that are this close into one block containing two lines rather than getting two blocks that contain one line each.
REP. PAUL LEONARD\n\nD-DAYTON

here is the document object:

Document(
  (pages): [Page(
    dimensions=(360, 480)
    (blocks): [
      Block(
        (lines): [Line(
          (words): [
            Word(value='REP.', confidence=0.99),
            Word(value='PAUL', confidence=1.0),
            Word(value='LEONARD', confidence=1.0),
          ]
        )]
        (artefacts): []
      ),
      Block(
        (lines): [Line(
          (words): [Word(value='D-DAYTON', confidence=0.99)]
        )]
        (artefacts): []
      ),
    ]
  )]
)

Alternatives

No response

Additional context

No response

@snewman-aa snewman-aa added the type: enhancement Improvement label Mar 13, 2024
@snewman-aa snewman-aa changed the title Vertical Vertical block separation Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant