Thanks for those suggestions.
My Pi 5 temperature using vcgencmd measure_temp peaks at 58C. I do use the Pi 5 Active Cooler.
I checked the clock speed while running the YOLO code and it was a constant 2.4GHz.
It seems the code from your tutorial already prints out some timing data; see the extract below:
The inference time ranges from 34 to 188ms in this small sample, any idea why? The FPS in your tutorial was quite steady.
0: 320x320 (no detections), 70.8ms
Speed: 3.5ms preprocess, 70.8ms inference, 2.0ms postprocess per image at shape (1, 3, 320, 320)
0: 320x320 (no detections), 59.8ms
Speed: 5.1ms preprocess, 59.8ms inference, 1.5ms postprocess per image at shape (1, 3, 320, 320)
0: 320x320 (no detections), 120.7ms
Speed: 3.4ms preprocess, 120.7ms inference, 1.0ms postprocess per image at shape (1, 3, 320, 320)
0: 320x320 (no detections), 33.7ms
Speed: 5.2ms preprocess, 33.7ms inference, 0.7ms postprocess per image at shape (1, 3, 320, 320)
0: 320x320 (no detections), 68.2ms
Speed: 3.9ms preprocess, 68.2ms inference, 1.0ms postprocess per image at shape (1, 3, 320, 320)
0: 320x320 (no detections), 188.1ms
Speed: 3.2ms preprocess, 188.1ms inference, 1.8ms postprocess per image at shape (1, 3, 320, 320)