Skip to content

[tests] Compare eager and compiled seg maps in the detection compile test - #2169

Merged
felixdittrich92 merged 1 commit into
mindee:mainfrom
quotentiroler:fix/detection-compiled-seg-maps-compare
Oct 16, 2026
Merged

felixdittrich92 merged 1 commit into
mindee:mainfrom
quotentiroler:fix/detection-compiled-seg-maps-compare

Conversation

@quotentiroler

Copy link
Copy Markdown
Contributor

test_torch_compiled_models in tests/pytorch/test_models_detection_pt.py unpacks the compiled predictor's output into compiled_out, seg_maps. That overwrites the eager seg maps, so the following assertion zips seg_maps with itself and always passes.

This keeps the compiled maps in compiled_seg_maps and compares them against the eager maps with the existing atol=1e-4. The tolerance is unchanged.

Ran locally (Linux, Python 3.11, torch 2.14.1+cpu): all 9 parametrized architectures pass, so eager and compiled maps do match today. The test can now catch a regression there.

Prepared with Claude Code; I reviewed and tested the change.

test_torch_compiled_models unpacked the compiled predictor's maps into
seg_maps, which overwrote the eager maps, so the seg map assertion
zipped seg_maps with itself and could never fail. Keep the compiled
maps in their own variable and compare them against the eager ones at
the existing atol=1e-4.
@felixdittrich92 felixdittrich92 self-assigned this Oct 16, 2026
@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.62%. Comparing base (7b91803) to head (6cd51ce).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##           main    #2169       +/-   ##
=========================================
+ Coverage      0   97.62%   +97.62%     
=========================================
  Files         0      170      +170     
  Lines         0    10740    +10740     
=========================================
+ Hits          0    10485    +10485     
- Misses        0      255      +255     
Flag Coverage Δ
unittests 97.62% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@felixdittrich92 felixdittrich92 added type: enhancement Improvement ext: tests Related to tests folder topic: text detection Related to the task of text detection labels Oct 16, 2026
@felixdittrich92 felixdittrich92 added this to the 1.2.0 milestone Oct 16, 2026

@felixdittrich92 felixdittrich92 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @quotentiroler 👍

@felixdittrich92
felixdittrich92 merged commit 463a7bc into mindee:main Oct 16, 2026
59 of 60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext: tests Related to tests folder topic: text detection Related to the task of text detection type: enhancement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants