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

Move cudnn.benchmarks(True) to LoadStreams #9258

Merged
merged 3 commits into from
Sep 2, 2022
Merged

Conversation

glenn-jocher
Copy link
Member

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

Also remove unused LoadWebcam class.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improvements in webcam and stream data loading for YOLOv5 inference.

πŸ“Š Key Changes

  • Removed usage of torch.backends.cudnn from predict.py and detect.py, moved it to dataloaders.py.
  • Deleted the LoadWebcam class, as webcam functionality is now unified with other streams in the LoadStreams class.
  • Simplified stream source validation by utilizing Path reading instead of manual file checks.
  • Optimized the stream update method by using cap.grab() solely rather than a read-grab combination.

🎯 Purpose & Impact

  • πŸš€ Performance: Centralizing cudnn.benchmark = True for consistent inference speed-up across different scripts.
  • πŸ“Ή Simplicity: By removing the LoadWebcam class and consolidating webcam handling into LoadStreams, code maintenance and future updates are simplified.
  • 🧼 Cleaner Code: Streamlining the method to obtain stream sources and updating frames provides cleaner and more efficient code, potentially leading to fewer bugs and easier troubleshooting.
  • πŸ› οΈ User Experience: These changes should result in a smoother and potentially faster experience for users performing detections via webcam or streamed inputs.

@glenn-jocher glenn-jocher self-assigned this Sep 2, 2022
@glenn-jocher glenn-jocher merged commit ffdb58b into master Sep 2, 2022
@glenn-jocher glenn-jocher deleted the cleanup/cudnn branch September 2, 2022 12:12
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Move cudnn.benchmarks(True) to LoadStreams

* Update dataloaders.py

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

* Move cudnn.benchmarks(True) to LoadStreams

Signed-off-by: Glenn Jocher <[email protected]>
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