Repository navigation
ocr: add --longest-edge 2048 default to granite-docling-v2 recipes - #219
Merged
Merged
Conversation
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.
Adds
--longest-edge(default2048, matchinglighton-ocr3-saturate.py; never upscales;0disables resize) andSERVING["longest_edge"] = 2048to bothocr/granite-docling-v2-saturate.pyandocr/granite-docling-v2-bucket.py.Why
ibm-granite/granite-docling-v2-2bmodel card recommends 144 DPI (~1,200–1,800 px for typical book/A4 pages).12,660prompt tokens) dense tiling mode, where the model silently drops 450–700 character chunks mid-paragraph and runs ~3.7× slower on prefill.2048px drops those pages to the3×4 + 1(3,368prompt tokens) grid, eliminating the silent mid-paragraph omissions while preserving small print better than1536/1280px.Validation
SERVINGparses withast.literal_evalin both scripts.page_pngdownscaling (2400×3200→1536×2048), no-upscale (800×1000preserved), and--longest-edge 0passthrough.6b0ef19b54072e8b7174ec6a).