Glossary

ONNX (Open Neural Network Exchange)

Discover how ONNX enhances AI model portability and interoperability, enabling seamless deployment of Ultralytics YOLO models across diverse platforms.

ONNX (Open Neural Network Exchange) is an open-source format for representing machine learning (ML) models. Co-developed by companies like Microsoft and Facebook, ONNX acts as a universal translator, enabling developers to move models between different ML frameworks and tools. This interoperability is crucial for streamlining the journey from model development to production. Instead of being locked into a single ecosystem, teams can train a model in one framework, like PyTorch, and deploy it for inference using another, such as TensorFlow or a specialized inference engine. Ultralytics YOLO models, for instance, can be easily exported to the ONNX format, providing maximum flexibility for deployment across various platforms.

How ONNX Works

ONNX provides a standard definition for a computational graph, along with a list of built-in operators. When you convert a model to the ONNX format, its architecture—composed of layers and mathematical operations—is mapped to this universal standard. The resulting .onnx file contains both the network structure and the trained model weights.

This standardized file can then be loaded by any tool that supports the ONNX specification. This includes:

Real-World Applications of ONNX

The flexibility of ONNX makes it invaluable in many computer vision and ML scenarios.

  1. Deploying AI on Edge Devices: A developer might train a complex object detection model like Ultralytics YOLO11 on a powerful desktop with NVIDIA GPUs. For the application to run on a low-power edge device like a Raspberry Pi or a smart camera used in retail analytics, the model is exported to ONNX. It can then be optimized by a runtime like ONNX Runtime or OpenVINO for efficient performance on the target hardware without needing the original PyTorch environment.

  2. Integrating Models into Diverse Applications: Consider a healthcare company that builds a medical image analysis model using Python and TensorFlow. The hospital's existing software infrastructure is built using C# and .NET. Instead of rewriting the model, the team exports it to ONNX. The C# application can then use the ONNX Runtime for .NET to integrate the model's capabilities directly, significantly reducing development time and complexity.

Join the Ultralytics community

Join the future of AI. Connect, collaborate, and grow with global innovators

Join now
Link copied to clipboard