Skip to content

fix(dpbench): normalize coordinates for upstream breaking change#215

Merged
PeterStaar-IBM merged 1 commit into
mainfrom
sami/fix-dpbench-breaking-change
May 28, 2026
Merged

fix(dpbench): normalize coordinates for upstream breaking change#215
PeterStaar-IBM merged 1 commit into
mainfrom
sami/fix-dpbench-breaking-change

Conversation

@samiuc

@samiuc samiuc commented May 12, 2026

Copy link
Copy Markdown
Contributor

The upstage/dp-bench dataset was updated on ~April 22 2026 (commit 24702c6, "Sync evaluation codes and leaderboard with the latest version")
commit: https://huggingface.co/datasets/upstage/dp-bench/commit/24702c61a2fb13325534be664653bc6e60250d13#d2h-687070
raw diff: https://huggingface.co/datasets/upstage/dp-bench/commit/24702c61a2fb13325534be664653bc6e60250d13.diff?file=dataset%2Freference.json

and silently changed reference.json coordinate format from normalized [0–1] to absolute image pixel values.

This causes _update_gt_doc to multiply pixel coordinates by page_width (~595 pts), and crop_bounding_box to multiply again by scale_x, producing bounding boxes of ~760 billion pixels and a PIL.Image.DecompressionBombError.

The fix added in the PR is to detect absolute pixel coordinates (max_x > 1.0 or max_y > 1.0) and normalize by page_image.width / height before the existing scaling logic. The fix is backward-compatible, datasets using normalized coords pass through unchanged.

Signed-off-by: samiuc <sami.ullah.chat@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @samiuc, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented May 12, 2026

Copy link
Copy Markdown

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@samiuc samiuc requested review from cau-git and divekarsc May 12, 2026 17:43
@laurachiticariu

Copy link
Copy Markdown
Contributor

@PeterStaar-IBM @cau-git could we get eyes on this?

@PeterStaar-IBM PeterStaar-IBM merged commit b40605e into main May 28, 2026
10 checks passed
@PeterStaar-IBM PeterStaar-IBM deleted the sami/fix-dpbench-breaking-change branch May 28, 2026 15:19
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.

3 participants