Repository navigation
fix(image): respect do_resize=False in ConvNeXT preprocessing - #771
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughConvNextFeatureExtractor now defaults do_resize to true. When do_resize is false, it returns without adding resize or center-crop transforms. Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The resize flag now has the intended behavior. No actionable issue was established that would prevent merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The fix preserves default behavior and makes explicitly disabled resizing work as requested. Its security significance is limited to configurations that disable resizing, where caller-supplied image dimensions can now reach inference. No security finding was established, but downstream size limits and resource exposure remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks @RAMZI0TO99! This is a good change for future models, since it makes ConvNeXT preprocessing respect do_resize the way HF does. It doesn't affect any of our current models. |
The ConvNeXT branch adds resize and its coupled crop despite
do_resize=False. For a patterned 96x160 input with target 224, the output becomes(3, 224, 224)rather than(3, 96, 160). Already-sized inputs can also have their pixels changed.This skips ConvNeXT geometry when resizing is explicitly disabled. An omitted flag still defaults to enabled, and subsequent rescaling/normalization continue. Tests check shape and pixel preservation for portrait/landscape/already-sized inputs, targets 224/384/512, enabled and omitted flags, subsequent processing, and unchanged CLIP/SigLIP behavior.
Validation on Windows 11, Python 3.13.5, NumPy 2.3.5, FastEmbed 0.8.1:
python -m pytest -q tests/test_convnext_do_resize.py tests/test_image_transform.py.The full model/OS/Python CI matrix was not run locally.
Split from #766 following the maintainer's request for one PR per problem. This branch is based directly on current main and contains only this problem's production change and regression module.