-
-
Notifications
You must be signed in to change notification settings - Fork 17.2k
fix the padding for rectangular inference #13632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
All Contributors have signed the CLA. ✅ |
👋 Hello @xielinzhen, thank you for submitting a Please review the following checklist to ensure your PR is ready for integration:
For bug reports, if you haven’t already, please provide a minimum reproducible example (MRE) to help us quickly identify and verify the issue. For more information, please see our Contributing Guide. If you have any questions, feel free to leave a comment. Thank you for contributing to Ultralytics! 🚀✨ |
I have read the CLA Document and I sign the CLA |
The current issue is that the image size used by val is 1984x1984, while that used by test is 1920x1920. The two are inconsistent, even though both specify the input image size as 1920x1920 |
Confirmed—rect val’s 0.5 padding bumps 1920 to 1984 via ceil while test honors 1920; your change to remove that extra pad aligns val and test—please confirm on current main that val now reports 1920x1920 so we can proceed after CI. |
Looks good—the screenshots confirm rect val/test now keep img=1920 when stride-aligned; I’ll approve and merge once CI passes. |
Hi @pderrenger, CI has passed. Could you please approve when you have a moment? These are screenshots of the code running after modification |
Thanks—CI is green and the results look good; approved and merged, please pull the latest main to confirm on your side. |
@pderrenger ![]() |
Thanks for the heads-up—looks like my earlier approval didn’t satisfy branch protection; I’ll re-approve now with write access and merge, then update this thread once it’s on main. |
yolov5/utils/dataloaders.py
Line 680 in 2540fd4
This part has already been rounded up, so there's no need to add padding
Problems will occur if non-zero padding is added
For example
shapes: [[1, 1]]
img_size: 1920
stride: 64
pad: 0.5
then
batch_shapes is [[1984, 1984]]
But 1920 is already a multiple of 64, so there's no need to change it to 1984
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Improved data loading behavior during training and validation for more consistent and predictable results. 🚀
📊 Key Changes
🎯 Purpose & Impact