RSS Towards Data Science - Medium

The Comprehensive Guide to Training and Running YOLOv8 Models on Custom Datasets

Training a YOLOv8 model on a custom dataset can be done using Python, the command line, or Google Colab. Ultralytics' YOLOv8 model is a cutting-edge model that uses a convolutional neural network to predict object classes and their bounding boxes. The model is flexible and can be trained on various platforms, using any dataset of choice. To get started, one needs to decide on the environment to train the model in, which can be local-based or cloud-based. Local-based training involves running the process directly on the system, using the physical hardware of the device, while cloud-based training allows users to take advantage of cloud servers' hardware. The dataset required for training a YOLOv8 model consists of a collection of images of various objects, along with a bounding box around the object that indicates its location within the image. The dataset should have a specific structure, with valid, train, and test folders, and images and labels folders within each. The images folder contains the object images, while the labels folder contains the data of the bounding box's position and size within each image, as well as the type of object represented by each image. To obtain a YOLOv8-compatible dataset, one can create their own dataset using tools like CVAT or use a pre-configured one from the Internet. CVAT is an annotation tool that allows users to create their own datasets by manually adding labels to images and videos. Once the dataset is created, it can be exported in the YOLOv8 format. The training process differs depending on whether one is training locally or on the cloud. For local training, a project folder needs to be created, and the dataset needs to be moved to this folder. A Python virtual environment with required YOLOv8 dependencies needs to be set up, and a config.yaml file needs to be created to specify important dataset information for training. The actual training can be done using the Python API or the CLI.
towardsdatascience.com
towardsdatascience.com
Create attached notes ...