Download and extract the following files from the BelgiumTS dataset:
DefinedTS.tar.gz
reducedSetTS.txt
Annotations/camera00.tar
throughcamera07.tar
Annotations/annotations.tar
Annotations/BelgiumTSD_annotations.zip
Put all the images in a /images folder
Install dependencies using:
pip install -r requirements.txt
git submodule update --init --recursive
Run these scripts in order to prepare your dataset for YOLO training:
-
reducedSet.py
Filters dataset to use only selected traffic sign classes. -
YOLOConversion.py
Converts annotations to YOLO format and organizes images and labels. -
split.py
Splits the dataset into 80% training and 20% validation. -
rewriteIds.py
Remaps class IDs to match your reduced label list. -
convertToJpg.py
Converts.jp2
images to.jpg
for YOLO compatibility.
Use the cuda.py
script to see if your gpu is available to speed up the training.
Use the train.py
script to train your YOLOv8 model:
You can edit the train.py
script and swap for other models like yolo11n.pt
, yolo8n.pt
, etc.
Modify hyperparameters in the command or data.yaml to experiment.
Ensure your data.yaml file has correct paths and class names.
To test the model use:
yolo detect predict model=path/to/model.pt source=path/to/Screenshot.png
Or use the video.py
script
This project uses the BelgiumTS dataset by Radu Timofte and collaborators. https://btsd.ethz.ch/shareddata/
This project uses modified versions of:
- Purpose:CBAM
- Modifications: CBAM
- License: AGPL-3.0
- Original Source: ultralytics/ultralytics
- Purpose: Class activation maps
- License: MIT