Skip to content

Conversation

glenn-jocher
Copy link
Member

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

Resolves #9111

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

🛠️ 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 <[email protected]>
@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 <[email protected]>

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

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

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.

Classification from webcam

1 participant