Skip to content

Retraining YOLOv8 for custom datasets. These codes have served as the basis for the deep learning practice of the CSIC 2024 artificial intelligence summer school.

Notifications You must be signed in to change notification settings

sergio94al/YOLOv8_Retraining

Repository files navigation

Retraining YOLOv8 for custom datasets

This repository provides a comprehensive guide on retraining a YOLO v8.2 network using custom datasets for precise traffic signal detection and identification, typically employed in autonomous vehicle applications. For this purpose, Google Colab and its GPU T4 are utilized to enhance the efficiency of the training process.

In this case, in order to limit the training, only the first 5 classes, which are traffic signs, are trained.

1. Data Preparing & Training

The structure of the data folders must be:

A. Data

  • images
    • train
    • val
  • labels
    • train
    • val

In this way, .yaml files can be created to feed into the network for training. Once the network is trained, training metrics such as mAP, accuracy, recall, etc... can be obtained. During training, a run-detect folder is created for training and validation where all metrics, graphs and other data such as the best network parameters and the last run parameters are stored.

B. Runs

  • detect
    • train
      • weights
        • best.pt
        • last.pt
    • val

2. Predicting new images and videos

Once we have the model created and the best.pt weight parameters have been saved, we can load them in order to make predictions.

- For image predictions:

- For video predictions:

3. Results from our custom YOLO

In this case, we employ a YOLO neural network retrained specifically for detecting traffic signals in images and videos, analyzing each frame individually. This enables us to obtain accurate and reliable predictions regarding the presence and location of traffic signals in diverse and dynamic environments.

4. Resources

  1. https://docs.ultralytics.com/
  2. https://colab.research.google.com/ (Edit - Configurations - GPU T4)
  3. https://github.com/kiarashrahmani/Traffic-sign-detection-using-yolo/tree/main/Dataset (Dataset used)

About

Retraining YOLOv8 for custom datasets. These codes have served as the basis for the deep learning practice of the CSIC 2024 artificial intelligence summer school.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published