fix(detr): match reference resize rounding - #1281
Conversation
Signed-off-by: wj <126436871+WenJing95@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 SummarySummaryDETR preprocessing now matches reference resize behavior. Tests cover half-tie and non-tie rounding for landscape and portrait inputs. They also verify engine-dimension compatibility. Validation
Architecture impact
WalkthroughThe DETR resize helper now matches Python’s ties-to-even rounding. Tests cover half-tie and non-tie dimensions for landscape and portrait inputs, plus preprocessing output dimensions. ChangesDETR resize rounding
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The resize rounding update is covered by tie, non-tie, orientation, and preprocessing tests; no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
Comment |
|
PR direction looks good. But community CI seems to be broken on this one. Let me retrigger |
Background
DETR resizes a 600x1200 image to 667x1333, while the reference produces 666x1333. This rejects inputs for an engine built at the reference dimensions.
Exit Criteria
Landscape and portrait inputs fit their reference-sized engine inputs.
Implementation
Round exact halves to the nearest even integer in the DETR preprocessor.
Change categories
Validation
Commands and Results
Native regression passed (21 checks); source-quality passed (164 tests).
Hardware, Environment, and Revisions
e853c2c: Ubuntu CPU, GCC 13.3; Transformers 5.2.0 reference.Not Run / Remaining Gaps
Checkpoint inference and full CMake suite: TensorRT environment unavailable.
Contributor Self-Review
Notes For Future Readers
Half ties follow Python's
round().Risk level
Only DETR resize dimensions change.