Ultralytics YOLOv8.2 ReleaseUltralytics YOLOv8.2 ReleaseUltralytics YOLOv8.2 Release Arrow
Green check
Link copied to clipboard

Export A Custom Trained Ultralytics YOLOv8 Model

Explore custom object detection with Ultralytics YOLOv8! Learn how to train, export, and run live inference on a webcam!

Join us as we take a closer look at custom object detection with Ultralytics YOLOv8. In this blogpost, we’ll explore the intricate process of training a custom model, exporting the trained weights, and running live inference on a webcam. 

Training a Custom Object Detection Model

In our previous video, we delved into the realm of training a YOLOv8 model on a custom cups dataset in Google Colab. We saw the training graph steadily improving, with the loss decreasing and the mean error position increasing. Based on this, our special model can now identify five different types of cups very accurately.

With our custom model trained and ready to go, it's time to explore the next frontier—exporting the trained weights and running live inference on a webcam.

Model inference is the process of using a trained computer vision model to make predictions or decisions based on new, unseen data. It is when the model uses input data, such as an image, and processes it through its learned parameters and structure. The model then produces an output, such as classification, detection, or segmentation, based on its training task. 

In practical terms, inference often involves deploying the trained model into a production environment where it can be used to process real-world data in real-time or batch-processing scenarios.

Exporting and Running Inference with the Trained Model

With trained model weights downloaded from Colab, we can seamlessly import them into a Python environment, ready to unleash the full potential of our custom model.

Using a few lines of code, we can set up a Python script to run live inference on a webcam, capturing real-time footage and detecting different cups with impressive accuracy. The power of YOLOv8 shines through as our model effortlessly identifies cups of various shapes, sizes, and colors, showcasing its versatility and reliability in real-world scenarios.

Fine-tuning models offer several benefits. They can detect, segment, or classify objects that pretrained models may not support. Additionally, they can assist researchers or data scientists in understanding how model architecture performs on real-world datasets.

Fig 1. Nicolai Nielsen outlining how to train a custom model, exporting the trained weights, and running live inference on a webcam.

Wrapping Up

From training a custom model to exporting the trained weights and running live inference on a webcam, we've witnessed the power and versatility of YOLOv8 firsthand.

Join us in our quest to unlock the full potential of custom object detection with Ultralytics YOLOv8. Together, let's shape the future of AI one detection at a time. Check out Ultralytics HUB, and our docs for further information of all things Ultralytics as well as join our community to keep up to date on the latest developments! 

If you’re curious about exporting custom trained YOLOv8 models and running inference on webcam, watch the full video here!

Facebook logoTwitter logoLinkedIn logoCopy-link symbol

Read more in this category

Let’s build the future
of AI together!

Begin your journey with the future of machine learning