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.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
- weights
- val
- train
Once we have the model created and the best.pt weight parameters have been saved, we can load them in order to make predictions.
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.
- https://docs.ultralytics.com/
- https://colab.research.google.com/ (Edit - Configurations - GPU T4)
- https://github.com/kiarashrahmani/Traffic-sign-detection-using-yolo/tree/main/Dataset (Dataset used)