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

Hub device mismatch bug fix #1619

Merged
merged 1 commit into from
Dec 6, 2020
Merged

Hub device mismatch bug fix #1619

merged 1 commit into from
Dec 6, 2020

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Dec 6, 2020

This PR attempts to fix issue #1617.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improvement to non-maximum suppression function in YOLOv5's utility code.

πŸ“Š Key Changes

  • Modified the way the number of classes (nc) is determined from the predictions to ensure compatibility.
  • Optimized the initialization of the output tensor to leverage the device of the input predictions, improving performance.

🎯 Purpose & Impact

  • πŸš€ The fix ensures that the number of classes is correctly calculated for any given input shape, which enhances the model's flexibility and robustness.
  • 🌐 By initializing the output tensor on the same device as the input, it eliminates unnecessary data transfers between devices (e.g., CPU to GPU), leading to faster and more efficient inference.
  • βœ… These changes will potentially benefit all users by providing more accurate object detection and improving the speed of the YOLOv5 model inference, without altering the model's core functionality.

@glenn-jocher glenn-jocher merged commit 68e6ab6 into master Dec 6, 2020
@glenn-jocher glenn-jocher deleted the mismatch_fix branch December 6, 2020 16:53
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.

Device mismatch when an image in the input batch gives 0 detections at inference time
1 participant