This project is developed to detect car brands in images and videos using YOLOv4. The model is trained with 10 car brands' images using pretrained YOLOv4 model.
Change path_name
variable in pyhton files to experiment with images and videos.
To run:
-
pip3 install -r requirements.txt
-
Download the model weights and put them in
weights
folder. -
To generate a car brand detection image on
data/chrysler.jpg
:python yolo_opencv.py
A new image
chrysler_yolo4.jpg
will appear which has the bounding boxes of the cars in the image. -
To read from a video file and make predictions on
data/mercedes.mp4
:python vid_yolo_opencv.py
This will start detecting car brands in that video, in the end, it'll save the resulting video to
output_video/mercedes.avi
Following car brands are used to detect in this project.
- Audi
- BMW
- Bentley
- Chrysler
- Ford
- Honda
- Hyundai
- Mercedes-Benz
- Nissan
- Toyota
The dataset is reconstructed from the Stanford AI Lab - Cars Dataset by preprocessing properly to make it convertible to YOLO format.
This project is developed using darknet framework and conda environment with following hardware and software configurations:
- GPU - Nvidia GeForce GTX 1660 Ti 6 GB
- CUDA - v11.3
- cudnn - v8.2.0
- OPENCV - v4.5.1