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 float zeros format #5491

Merged
merged 2 commits into from
Nov 3, 2021
Merged

Fix float zeros format #5491

merged 2 commits into from
Nov 3, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Nov 3, 2021

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Updated number literals in division to integers for consistency across codebase.

πŸ“Š Key Changes

  • Unified the division operation by using integers (255) instead of floats (255.0) where values are scaled.
  • In some instances, changed from a floating point number with a decimal (1.) to an integer (1) when used in division or as a tensor value.

🎯 Purpose & Impact

  • Consistency: Ensures consistency in using number literals throughout the codebase, avoiding unnecessary type casting.
  • Clarity: Using integers for division by 255 when normalizing image pixel values provides clear intent and understanding for developers and users.
  • Performance: May negligibly improve performance by using integer division where applicable, though modern compilers may already optimize such cases.
  • No Functional Change: Should not affect the output or the overall functionality of the models, thus the impact on end-users should be minimal or none.

@glenn-jocher glenn-jocher mentioned this pull request Nov 3, 2021
@glenn-jocher glenn-jocher merged commit 5866646 into master Nov 3, 2021
@glenn-jocher glenn-jocher deleted the fix/floats branch November 3, 2021 22:36
@glenn-jocher glenn-jocher self-assigned this Nov 3, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Fix float zeros format

* 255 to integer
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

1 participant