Object detection and tracking with Ultralytics YOLOv8
Learn object detection and tracking with Ultralytics YOLOv8: set up the model, configure ByteTrack or BoT-SORT, and run real-time inference on video and webcam.
Nuvola Ladi3 min readListen to this article

Today, we're diving into another chapter of our journey with Ultralytics YOLOv8. In this episode, our focus is on object detection and tracking, a fundamental aspect of computer vision that enables many applications across industries. Join us as we explore the capabilities of YOLOv8 in this domain, with Nicolai Nielsen.
Object detection and tracking play crucial roles in various scenarios, from surveillance systems to industrial automation. With Ultralytics YOLOv8, these capabilities are easy to put to work. Nicolai walks us through the process, highlighting key insights and practical demonstrations along the way.
Setting the stage#
Before delving into the intricacies of object detection and tracking, Nicolai emphasizes the versatility of Ultralytics YOLOv8. Whether it's identifying individuals in a crowded space or monitoring objects on a production line, YOLOv8 offers a robust solution.
Model setup#
In this video, Nicolai works in Visual Studio Code and demonstrates how to set up the Ultralytics YOLOv8 model for object detection and tracking. Using the medium model, he shows how even larger models can run in real time on capable hardware.
Configuring the tracker#
In object tracking, choosing the right tracker is important. Nicolai introduces us to the ByteTrack algorithm, known for its accuracy and reliability. Additionally, he highlights the versatility of Ultralytics YOLOv8 by mentioning alternative trackers like BoT-SORT, catering to diverse tracking requirements.
Real-time inference#
With the model and tracker configured, it's time to witness Ultralytics YOLOv8 in action. During this tutorial, we can see how the program runs, providing a live demonstration of object detection and tracking using a pre-recorded video. Each object is assigned a unique ID, so it can be followed from frame to frame.

Fig 1. Nicolai Nielsen showcasing the inner-working of object detection and tracking with Ultralytics YOLOv8.
Live webcam testing#
Taking the demonstration a step further, we see how one can switch to a live webcam feed to showcase real-time tracking capabilities. From detecting individuals to identifying objects, Ultralytics YOLOv8 maintains consistency in tracking, even amidst camera movements and occlusions.
Object tracking on multiple streams#
Object tracking across multiple video streams using multithreading is ideal for handling numerous surveillance camera feeds. Using Python's threading module with Ultralytics YOLOv8, each thread manages a separate tracker instance, enabling efficient background processing. This feature is useful and plays an important role in advanced analytics.
Practical applications#
As the demonstration unfolds, Nicolai underscores the practical relevance of object detection and tracking. From the healthcare industry to agriculture and the manufacturing industry, the applications are vast and varied. He also emphasizes the importance of integrating tracking functionalities alongside detection for enhanced efficiency and accuracy.
Wrapping up#
In conclusion, the countless applications for object detection and tracking allow for flexibility and creative solutions within any industry. Join us in exploring what computer vision can do with Ultralytics YOLOv8.
Stay tuned and join our community as we continue to explore the ever-evolving landscape of artificial intelligence and machine learning.
Written by
Comments
Ask a question, share your results, or help someone else.










