From the course: Hands-On AI: Computer Vision Projects with Ultralytics and OpenCV

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

How to predict and track the detected objects

How to predict and track the detected objects

- [Instructor] In this video, we will dive into the usage of predict and track mode using the Ultralytics Python package. The resources used in this video are available in the course code sub-directory O3-08. By now, you are likely familiar with the predict mode as we have used it in the previous few videos of this chapter. Here, we will go a bit deeper. We will explore different arguments that we can use with the predict mode, and we will also explore how to use the track mode. In track and predict.py file, line number one, we are importing the YOLO module. In line number three, we initialize the object detection model, which is Ultralytics YOLO 11. Next, in line number five, we are using the predict mode. Here, we can pass the source image. Let's go to predict and track mode documentation. Here, we can see the key features of predict mode. For example, we can use multiple data sources with the predict mode, we can use the batch processing, and so on. Here, we have the core snippet…

Contents