Training YOLO on a custom dataset
Building on top of others’ work is very important to becoming a successful practitioner in deep learning. For this implementation, we will use the official YOLOv4 implementation to identify the location of buses and trucks in images. We will clone the repository of the YOLO authors’ own implementation and customize it to our needs in the following code.
To train the latest YOLO models, we strongly recommend you go through the following repos – https://github.com/ultralytics/ultralytics and https://github.com/WongKinYiu/yolov7.
We have provided the working implementation of YOLOv8 as Training_YOLOv8.ipynb
within the Chapter08
folder on GitHub at https://bit.ly/mcvp-2e.
Installing Darknet
First, pull the darknet
repository from GitHub and compile it in the environment. The model is written in a separate language called Darknet, which is different from PyTorch. We will do so using the following...