From the course: Deep Learning and Computer Vision: Object Detection with PyTorch

Unlock this course with a free trial

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

Coding YOLOv5 in PyTorch

Coding YOLOv5 in PyTorch

- [Instructor] Welcome to this video on coding and training the YOLOv5 model. YOLOv5 is the most popular and powerful model for real-time object detection. Today we'll walk through the loading, the pre-trained weights, preparing a custom dataset, and training the model. We'll start by loading the pre-trained weights for YOLOv5. This saves us the time and resources needed to train the model from scratch. Let's import the necessary libraries and load the model using PyTorch torch.hub functionality. As we have loaded the YOLOv5 version, which is the smallest and fastest variant, this model will serve as the base for fine-tuning on our custom dataset. Now, let's prepare our custom dataset. Before training the model, we'll need to annotate the dataset with bounding boxes and labels. We can use popular tools like labeling or Roboflow to create annotations in YOLO format. Once our annotations are ready, we can load the dataset using a custom PyTorch dataset class. This class helps load our…

Contents