From the course: Deep Learning with Python: Convolutional Neural Networks

Unlock this course with a free trial

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

Using a pretrained model for image segmentation in Python

Using a pretrained model for image segmentation in Python - Python Tutorial

From the course: Deep Learning with Python: Convolutional Neural Networks

Using a pretrained model for image segmentation in Python

- [Instructor] In this tutorial, you'll learn how to use a pre-trained YOLO model for image segmentation. Before we begin, let's select a kernel. By the end of this tutorial, you know how to load and prepare a YOLO image segmentation model for inference. You also know how to run segmentation inference and inspect raw mask outputs. Finally, you know how to overlay masks, bounding boxes, and labels on the original image. To begin, we import the YOLO class from the ultralytics package, and we specify a model. This time around, we're going to use the nano model, which is the yolo11n-seg for segmentation. So let's go ahead and import the weight for our model. So once that process is complete, we now specify a path for the image that we want to segment. So let's run the code here. So now our image path is specified in a variable called image_path. So, but before we actually segment the image itself, let's preview the image to see exactly what it is that we specified here. Just to verify…

Contents