Improved detect.py timing
#4741
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated detect.py timing to match hub and val.py formats. Allows for simpler FPS calculation for students, i.e. #4737
$ python detect.py YOLOv5 🚀 v5.0-419-gc5360f6 torch 1.9.0 CPU Fusing layers... Model Summary: 224 layers, 7266973 parameters, 0 gradients image 1/2 /Users/glennjocher/PycharmProjects/yolov5/data/images/bus.jpg: 640x480 4 persons, 1 bus, 1 fire hydrant, Done. (0.240s) image 2/2 /Users/glennjocher/PycharmProjects/yolov5/data/images/zidane.jpg: 384x640 2 persons, 2 ties, Done. (0.191s) Speed: 1.1ms pre-process, 215.5ms inference, 1.1ms NMS per image at shape (1, 3, 640, 640) <------- NEW Results saved to runs/detect/exp12🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Significant refactor of timing logic in inference scripts for enhanced transparency and clarity.
📊 Key Changes
timemodule indetect.py.detect.pyandval.pyfor consistency.🎯 Purpose & Impact