Skip to content

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Sep 4, 2022

Signed-off-by: Glenn Jocher [email protected]

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Improved model inference and validation by streamlining output handling.

📊 Key Changes

  • 🔨 Modified forward method in common.py to handle outputs more effectively.
  • 🚮 Removed val parameter from forward method to simplify the calling interface.
  • ➕ Added from_numpy method to convert NumPy arrays to PyTorch tensors only when necessary.
  • ✨ Updated non_max_suppression in general.py to accept list/tuple inputs, catering to different model output types.
  • 🧹 Cleaned up inference and loss computation in val.py by eliminating unnecessary conditionals.

🎯 Purpose & Impact

  • 🚀 Streamlining the output processing enhances code maintainability and reduces potential for bugs.
  • 📈 The removal of superfluous parameters leads to clearer function calls, making the API easier for developers to use.
  • 🧠 The impact on users includes potentially faster inference times and smoother integration when using the model for different purposes, such as training or validation.

@glenn-jocher glenn-jocher merged commit 7aa263c into master Sep 4, 2022
@glenn-jocher glenn-jocher deleted the update/dmb branch September 4, 2022 13:39
@glenn-jocher glenn-jocher self-assigned this Sep 4, 2022
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Update DetectMultiBackend for tuple outputs 2

Signed-off-by: Glenn Jocher <[email protected]>

* Update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update

* Update

* Update

Signed-off-by: Glenn Jocher <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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