Ultralytics YOLO27:
Ultralytics YOLO

Export and optimize Ultralytics YOLOv8 for inference on Intel OpenVINO

Optimize your Ultralytics YOLOv8 model for inference using OpenVINO. Follow our guide to convert PyTorch models to ONNX and optimize them for real-time applications.

NUNuvola Ladi4 min read
Exporting and optimizing Ultralytics YOLOv8 for inference on Intel OpenVINO

In this blogpost, we'll be taking a look at how you can export and optimize your pre-trained or custom-trained Ultralytics YOLOv8 model for inference using OpenVINO. If you're using an Intel-based system, whether it’s a CPU or GPU, this guide will show you how to significantly speed up your model with minimal effort.

Why optimize Ultralytics YOLOv8 with OpenVINO?#

Optimizing your Ultralytics YOLOv8 model with OpenVINO can provide up to a 3x speed increase on inference tasks, particularly if you're running an Intel CPU. This performance boost can make a huge difference in real-time applications, from object detection to segmentation and security systems.

Steps to export and optimize your Ultralytics YOLOv8 model#

Understanding the process#

First things first, let’s break down the process. We're going to convert a PyTorch model to ONNX and then optimize it using OpenVINO. This process involves a few straightforward steps and can be applied to various models and formats including TensorFlow, PyTorch, Caffe, and ONNX.

Exporting the model#

Jumping into the Ultralytics documentation, we find that exporting a YOLOv8 model involves using the export method from the Ultralytics framework. This method allows us to convert our model from PyTorch to ONNX, and finally, optimize it for OpenVINO. The result is a model that runs significantly faster, leveraging Intel's powerful hardware.

Installing dependencies#

Before running the export script, you’ll need to ensure that all necessary dependencies are installed. These include the Ultralytics library, ONNX, and OpenVINO. Installing these packages is a simple process that can be done via pip, the Python package installer.

Running the export script#

Once your environment is set up, you can run your export script. This script will convert your PyTorch model to ONNX and then to OpenVINO. The process is straightforward and involves calling a single function to handle the export. The Ultralytics framework makes it easy to convert and optimize your models, ensuring you get the best performance with minimal hassle.

Nicolai Nielsen outlining how to run the model export script

Fig 1. Nicolai Nielsen outlining how to run the export script.

Comparing performance#

After exporting, it’s essential to compare the performance of the original and optimized models. By benchmarking the inference time of both models, you can clearly see the performance gains. Typically, the OpenVINO model will show a significant reduction in inference time compared to the original PyTorch model. This is especially true for larger models where the performance boost is most noticeable.

Real-world application and benefits#

Optimizing Ultralytics YOLOv8 models with OpenVINO is particularly beneficial for applications requiring real-time processing. Here are a few examples:

  • Security Systems: Real-time object detection can alert security personnel instantly, enhancing safety and responsiveness.
  • Automated Vehicles: Faster inference speeds improve the responsiveness of autonomous driving systems, making them safer and more reliable.
  • Healthcare: Quick image processing for diagnostic tools can save lives by providing faster results, allowing for timely interventions.

By implementing these optimizations, you not only improve performance but also enhance the reliability and efficiency of your applications. This can lead to better user experiences, increased productivity, and more innovative solutions.

Wrapping up#

Exporting and optimizing a Ultralytics YOLOv8 model for OpenVINO is a powerful way to leverage Intel hardware for faster and more efficient AI applications. With just a few simple steps, you can transform your model’s performance and apply it to real-world scenarios effectively.

Make sure to check out more tutorials and guides from Ultralytics to keep enhancing your AI projects. Visit our GitHub repository and join the Ultralytics community for more insights and updates. Let’s innovate together!

Remember, optimizing your models is not just about speed—it's about unlocking new possibilities and ensuring your AI solutions are robust, efficient, and ready for the future.

Explore solutions

Computer vision for aerial imagery

Computer vision for aerial imagery

Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Transform drone and aerial imagery into real-time insights for agriculture, aquaculture, environmental monitoring, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Bring vision AI to aerial monitoring with Ultralytics YOLO models. Power drones, aerospace workflows, environmental conservation & geospatial industries with computer vision solutions.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning