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

Add optional transforms argument to LoadStreams() #9105

Merged
merged 4 commits into from
Aug 23, 2022

Conversation

glenn-jocher
Copy link
Member

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

Prepare for streaming classification support

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

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Simplified webcam and stream processing in YOLOv5 data loading code.

πŸ“Š Key Changes

  • πŸ” Improved naming consistency (renamed img to im to match the rest of the codebase).
  • πŸ”§ Removed unnecessary variable assignments for conciseness.
  • πŸ’Ό Centralized image transformation and letterboxing logic for frames from videos and webcams.
  • πŸ”„ Standardized image converting procedure (BGR to RGB, HWC to CHW).
  • ✨ Added an optional transforms parameter to the stream loader to enable custom transformations.
  • 🧹 Code cleanup for better readability and maintenance.

🎯 Purpose & Impact

  • πŸš€ Streamlines the data loading process for better performance and ease of further modifications.
  • πŸ’‘ Makes the code more accessible for developers due to consistent naming and reduced complexity.
  • πŸ“ˆ Enhances flexibility with transform customizations, potentially improving the effectiveness of different use cases.
  • πŸ” The potential increase in efficiency can benefit real-time applications relying on webcam and stream data, leading to smoother end-user experiences.

Prepare for streaming classification support

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher self-assigned this Aug 23, 2022
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
@glenn-jocher glenn-jocher merged commit 48e56d3 into master Aug 23, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch August 23, 2022 12:37
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Add optional `transforms` argument to LoadStreams()

Prepare for streaming classification support

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

* Cleanup

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

* fix

* batch size > 1 fix

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

None yet

1 participant