Vehicle Detection Using Deep Learning and YOLO Algorithm

Vehicle Detection Using Deep Learning and YOLO Algorithm



take or find vehicle images for create a special dataset for fine-tuning.

Train : 70%

Validition : 20%

Test : 10%


config dataset.yaml for the address and information of your dataset.

path: Dataset/dataset-vehicles  # dataset root dir
train: images/train  # train images (relative to 'path')
val: images/val  # val images (relative to 'path')
test:  # test images (optional)

# Classes
nc: 5  # number of classes
names: [ 'Car', 'Motorcycle', 'Truck', 'Bus', 'Bicycle']  # class names

Clone Vehicle-Detection Repository

git clone
cd Vehicle-Detection
pip install -r requirements.txt


to have mAP, loss, confusion matrix, and other metrics, sign in


fine-tuning on a pre-trained model of yolov5.

python --img 640 --batch 16 --epochs 50 --data dataset.yaml --weights


after train, gives you weights of train and you should use them for test.

python --weights runs/train/exp12/weights/ --source test_images/imtest13.JPG

you can also use the weight file in path ‘runs/train/exp12/weights/’ without the train. this weight is the result of 128 epoch train on the following dataset.

My Vehicle Dataset


Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

GIPHY App Key not set. Please check settings

How to Automatically Run Your Laravel PestPHP Tests on Each GitHub Pull Request?

Cross Parcha Lyrics — Gurlez Akhtar | Sandeep Brar