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

Update test.py profiling #3555

Merged
merged 3 commits into from
Jun 9, 2021
Merged

Update test.py profiling #3555

merged 3 commits into from
Jun 9, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jun 9, 2021

Improved test.py profiling to match the new YOLOv5 PyTorch Hub profiling format:

Speed: 0.2ms pre-process, 9.2ms inference, 0.8ms NMS per image at shape (32, 3, 640, 640)

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Refined half-precision utilization and timing metrics in testing routines.

📊 Key Changes

  • Renamed half_precision argument to half for clarity.
  • Refactored timing code to include a pre-processing step.
  • Removed an unnecessary random library import in plots.py.
  • Simplified imports of an example file in plots.py for consistency.
  • Adjusted train.py to directly use opt values instead of reassigning them redundantly.
  • Included additional condition checks for opt.weights being a list before iterating.

🎯 Purpose & Impact

  • Clarity: The argument rename makes the half-precision flag usage clearer.
  • 🚀 Enhanced Metrics: New timing for the pre-processing stage helps users better understand where time is spent during inference.
  • 🧹 Code Cleanup: Removal of extraneous code contributes to cleaner, more maintainable codebase.
  • 👁️ User Insights: Updates provide more granular timing details, offering users more insight into their model's performance. Users interested in optimization will now have more detailed information on their model's speed with the added pre-processing time reporting.

@glenn-jocher glenn-jocher merged commit 5948f20 into master Jun 9, 2021
@glenn-jocher glenn-jocher deleted the test_timing_fix branch June 9, 2021 14:25
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 2021
* Update test.py profiling

* half_precision to half

* inplace

(cherry picked from commit 5948f20)
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Update test.py profiling

* half_precision to half

* inplace
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.

1 participant