Trained in PyTorch,
deployed without a cloud round-trip.
We train computer vision models in PyTorch and export them to ONNX Runtime for edge and embedded deployment — portable inference that runs on the device itself, not a round-trip to a cloud GPU for every frame.
Serving UK and EU clients: GDPR, EU AI Act, and data residency are covered on our Trust & Safety page.
A training framework
and a portable runtime.
PyTorch is where the model gets trained: a Python-first deep learning framework with eager execution and dynamic computation graphs, which is why it's the default for research and iteration — you can inspect and change the graph as code runs, instead of only at compile time. It's BSD-licensed and governed by the PyTorch Foundation under the Linux Foundation, so there's no single vendor controlling where it goes next.
ONNX is not a training framework, and treating it like one is the most common confusion we run into. ONNX — Open Neural Network Exchange — is an open file format and operator specification for representing a trained model's computation graph portably. ONNX Runtime is the separate piece that actually executes that graph at inference time, through pluggable execution providers for CPU, GPU, and a growing set of embedded accelerators. Exporting converts PyTorch's dynamic graph into the more static representation ONNX expects, usually via tracing or scripting — and that conversion is where the real engineering happens, not a button pressed once at the end of training.
The alternatives worth knowing: TensorRT is faster on NVIDIA hardware specifically, but ties the deployment to that vendor; TFLite and Core ML are strong choices if a project is already committed to the TensorFlow or Apple ecosystem respectively. ONNX Runtime's case is cross-platform reach — the same exported graph runs on a factory-floor x86 box, an ARM-based edge gateway, or a GPU server without re-architecting the model for each target.
This is the exact pipeline behind most of our manufacturing and agritech work, where the gap between lab accuracy and field accuracy is the whole problem — the same class of issue documented in our vision field-accuracy case study. Export once, run anywhere sounds simple; in practice it's a discipline, not a single step.
The export isn't
the hard part.
Converting a model to ONNX is mechanical. Getting an export that's numerically identical to the PyTorch model, and that still performs once it's deployed, is the actual work — and most of the failure modes below never show up in a script that only checks whether the export completed.
Batch size, sequence length, and image resolution get hardcoded into the graph by default unless they're declared as dynamic axes during export. Skip this and the model passes testing at one input size, then misbehaves — sometimes silently, not with an error — the moment a different shape hits it in production.
Custom CUDA kernels, certain interpolation modes, and some newer PyTorch ops don't map cleanly onto an ONNX opset. We check for these before training wraps, not after, because working around an unsupported op usually means registering a symbolic function or restructuring that part of the model.
Post-training INT8 quantization and quantization-aware training trade off differently, and which is worth the engineering effort depends on which execution provider the target hardware actually supports well — a CPU execution provider, an ARM NN path, or a vendor-specific NPU provider each behave differently.
We pin an ONNX opset version and compare PyTorch and ONNX Runtime outputs on identical inputs before calling an export done — not just confirming it loads, but confirming the two runtimes agree within tolerance, since opset mismatches cause quiet numerical drift rather than a loud failure.
Part of our
vision AI work.
This stack sits inside the broader computer vision and edge deployment work we do end to end — it's rarely the final deliverable on its own, since a client needs the inference pipeline running on real hardware, feeding real decisions, not just a model artifact that exports cleanly in a notebook.
The full service this sits inside — from custom model training and dataset collection through to on-device inference and the hardware selection that decides which execution provider is even an option.
The pattern this training-to-deployment pipeline is built to prevent — a model that tests well but underperforms once deployed. (Illustrative write-up, not a specific project's exact hardware.)
Monitoring and feedback loops for flagging low-confidence predictions once a model is live on the line, plus the retraining triggers that catch drift before it becomes a quality problem someone notices downstream.
Calculate extraction accuracy, review volume, latency, and cost for a document pipeline.
Before you
book a call.
The questions we get asked most about PyTorch and edge deployment — answered straight, no sales pitch.
Why train in PyTorch and deploy via ONNX Runtime instead of deploying PyTorch directly?
PyTorch is a training framework, not an edge runtime. Exporting to ONNX gives a portable model format that runs efficiently across different edge and embedded hardware without carrying the full training framework's footprint into a device that may have limited memory and no GPU.
Does this work on hardware without a GPU?
That's the point of the ONNX Runtime step — it's built for efficient CPU and embedded-accelerator inference, not just GPU-backed deployment. The right export and quantization settings depend on the target hardware, which we confirm before committing to an approach.
What's the actual difference between ONNX and ONNX Runtime?
ONNX is the file format and operator specification — a static description of a trained model's computation graph. ONNX Runtime is the separate engine that loads that file and executes it, through execution providers for different hardware. The two names get used interchangeably, but the distinction matters the moment something goes wrong: a graph can be valid ONNX and still run poorly, or differently, on a given runtime version or execution provider.
What actually causes an ONNX export to go wrong?
Almost never a loud failure. The common cases are a dynamic dimension that got hardcoded during export, a custom op that silently falls back to a slower or subtly different implementation, or an opset mismatch that shifts numerical output by a small amount that compounds across a video stream. We verify outputs numerically against the original PyTorch model before calling an export finished, specifically because these failures don't announce themselves.
What problem does this stack actually solve?
The common failure mode isn't the model architecture — it's a mismatch between studio training conditions and real deployment conditions (lighting, motion blur, lens distortion), the kind of gap our vision field-accuracy write-up describes. PyTorch plus a disciplined training-to-deployment pipeline is how that gap gets closed, not just how the model gets exported.
Tell us what
you're trying to deploy.
Book a 30-minute call — we'll tell you honestly whether your model has a lab-to-field gap, and what it would take to close it.