fix(layout): remove wrapper picture proposals - #4149
Open
cau-git wants to merge 3 commits into
Open
Conversation
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Contributor
|
✅ DCO Check Passed Thanks @cau-git, all your commits are properly signed off. 🎉 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
Member
Author
|
@phact could you please test this PR with a few more input samples? Thanks. |
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
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.
Summary
PICTUREproposals that wrap every surviving model-detected layout element when the page area outside the proposal is a single background color.Difference from #4047
This targets the same failure as #4047: landscape slide-like content embedded in a portrait PDF can be classified as one large picture, hiding machine-readable text and causing picture description to receive the whole slide.
#4047 computes a union from regular and special clusters and removes a picture when its bounding box equals that union. Because the candidate picture participates in the union, any picture containing the remaining clusters defines the union itself. The decision therefore reduces to containment and does not inspect the surrounding page raster.
This PR ports the fix onto current
mainand requires three independent signals:A nested picture is deliberately not required, so text-only slide frames are handled as well.
Result
On the reported
page28.pdf, currentmainproduces one outer picture containing all eight text items, leaving Markdown with only an image placeholder. This change exposes the eight native text items and retains the two internal picture proposals, achieving the same user-visible goal as #4047 with narrower removal conditions.Validation
28 passedintests/test_layout_postprocessor.pymake validateDOCLING_DEVICE=cpu,--device cpu, and--no-ocrRelated: #4047