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 numpy to torch cls streaming bug #9112

Merged
merged 2 commits into from
Aug 23, 2022
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Aug 23, 2022

Resolves #9111

Signed-off-by: Glenn Jocher glenn.jocher@ultralytics.com

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Improved image tensor conversion in YOLOv5 classification predict script.

📊 Key Changes

  • Added an explicit import statement for torch.
  • Modified the image tensor preparation to ensure it is converted to a PyTorch tensor before being sent to the device.

🎯 Purpose & Impact

  • These changes ensure compatibility and proper tensor handling across different versions of PyTorch or various input formats.
  • Users can expect more reliable and consistent behavior when using the classification model on diverse image inputs, leading to smoother user experiences and potentially better classification performance. 🚀

Resolves #9111

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher self-assigned this Aug 23, 2022
@glenn-jocher glenn-jocher merged commit e6f54c5 into master Aug 23, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch August 23, 2022 21:54
@glenn-jocher glenn-jocher mentioned this pull request Aug 23, 2022
2 tasks
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Fix numpy to torch cls streaming bug

Resolves ultralytics#9111

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

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

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

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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.

Classification from webcam
1 participant