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 25,300 courses taught by industry experts.
Usage of Ultralytics Package using Python - OpenCV Tutorial
From the course: Hands-On AI: Computer Vision Projects with Ultralytics and OpenCV
Usage of Ultralytics Package using Python
- [Narrator] In this video, we'll cover how to use the Ultralytics YOLO package in Python. We will explore how to load a model, how to run prediction with the Ultralytics modes, and how to extract the results. The resources that we will use in this video are inside the course code subdirectory 01-04. Let's go to line number 7. Here we will load the model. We will use the YOLO module that we already imported in the line number 3. It requires one argument, which is model file path, or model file name. Let's use the state-of-the-art object detection model, yolo11, and then we can select its variant. For example, nano, small, medium, large, or extra large. Whatever we want to use, we can add here. Let's use nano variant here, and then the model extension. If we want to replace the nano with the medium model, we will just replace n with m, and so on. Let's store the initialization of the model in a variable name model, and that way we can use it for multiple purposes. Let's go to line…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.