Three runners -- eval_pt, eval_onnx, eval_ncnn -- over one measured pipeline,
differing only in which file they hand to Ultralytics. Three independently
written scripts would drift and make the timings incomparable, which is the
opposite of the point.
Six stages timed separately: read, preprocess, inference, postprocess, depth,
total. Only inference changes with the export format; splitting the rest out is
what shows how much of a real frame a faster model actually buys. Images are
read here rather than passing predict() a path, so disk I/O does not inflate
preprocess. Five warm-up frames discarded, p50 and p95 rather than mean.
On x86 at 4 cores: ONNX 32.36 ms inference against PyTorch's 54.65, 1.69x, and
1.57x end to end.
The depth row is the control. It is identical numpy over the same boxes in every
run, so it has to be constant across formats -- and it was not. Unpinned it read
1.5 ms under PyTorch and 16.2 ms under ONNX, a 10x swing in code that never
changed: onnxruntime defa…