Skip to content

Handle bounding boxes in 2D ndimage warping - #117

Open
sylvesterkaczmarek wants to merge 1 commit into
google-research:mainfrom
sylvesterkaczmarek:fix-2d-warp-bounding-boxes
Open

sylvesterkaczmarek wants to merge 1 commit into
google-research:mainfrom
sylvesterkaczmarek:fix-2d-warp-bounding-boxes

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

ndimage_warp assumes three spatial dimensions when reshaping map offsets, allocating an explicit output box and computing map/output offsets. With 2D images, explicit bounding boxes cause broadcasting errors or add an unwanted axis.

Make those operations dimension-aware. Add 2D regressions and 3D controls with translated/cropped boxes, unequal strides, output scaling and threaded warping.

Validation: python -m pytest -q tests/warp_test.py tests/map_utils_test.py tests/flow_utils_test.py passes all 32 tests. Five new 2D regression cases fail on unchanged upstream; all five 3D controls already pass. Syntax parsing and git diff --check pass.

@sylvesterkaczmarek

Copy link
Copy Markdown
Author

@mjanusz This PR is current with main and has no public failing checks; only the Google import/review gate remains. It adds the 2D ndimage bounding-box handling with focused coverage. Could you review the current head when convenient?

@sylvesterkaczmarek
sylvesterkaczmarek force-pushed the fix-2d-warp-bounding-boxes branch from 720a2c0 to bfa6f38 Compare October 5, 2026 21:29
@sylvesterkaczmarek

Copy link
Copy Markdown
Author

@mjanusz Refreshed onto current main. The branch was 1 commit behind and is now 0 behind and mergeable; head bfa6f38fc9fcd60ac727843f4ce54df1a862cfc3 is GitHub Verified. The focused 2D/3D ndimage bounding-box regression class passes 10/10 selected tests. git diff --check is clean; the repository-wide Pyink reformat signal also reproduces on current main, so I left unrelated formatting unchanged. CLA is green and Copybara is waiting for internal safe-review approval. Could you review the refreshed head when convenient?

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.

1 participant