Skip to content

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.

1 participant