Skip to content
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

fix padding for rectangular inference #1165

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

menggui1993
Copy link
Contributor

@menggui1993 menggui1993 commented Oct 19, 2020

Image size will be padded to minimum multiple of 32 for rectangular inference.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved image padding granularity in YOLOv5 pre-processing.

πŸ“Š Key Changes

  • Modified the padding calculation in the letterbox function within datasets.py.
  • Padding values are now a multiple of 32 instead of 64.

🎯 Purpose & Impact

  • πŸ“ˆ This change enhances the flexibility in image processing by allowing finer-grained padding, which can improve model accuracy as it provides more precise scaling options.
  • πŸ” Users may notice improved detection performance, especially with small objects, due to less distortion during image resizing.
  • πŸš€ Models could potentially train and infer slightly faster as a result of the reduced padding in some cases.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello @menggui1993, thank you for submitting a PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • Verify your PR is up-to-date with origin/master. If your PR is behind origin/master update by running the following, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
git checkout feature  # <----- replace 'feature' with local branch name
git rebase upstream/master
git push -u origin -f
  • Verify all Continuous Integration (CI) checks are passing.
  • Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee

@glenn-jocher
Copy link
Member

@menggui1993 thank you for your contributions.

@glenn-jocher glenn-jocher merged commit 9291daa into ultralytics:master Oct 19, 2020
burglarhobbit pushed a commit to burglarhobbit/yolov5 that referenced this pull request Jan 1, 2021
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
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.

None yet

2 participants