ID: 5f9af2b8f6c29e2f47218749

Vehicle Make Recognition

by Spectrico

Vehicle Make Recognition using YOLOv4 Object Detector

License: MIT License

Tags: Vehicle recognition

 Model stats and performance
Framework OpenCV
OS Used Windows
Publication View
Inference time in seconds per sample.

Performance data is not available.


Vehicle Make Recognition using YOLOv4 Object Detector


A Python example for using Spectrico's car brand classifier. It consists of an object detector for finding the cars, and a classifier to recognize the brands of the detected cars. The object detector is an implementation of YOLOv4 (OpenCV DNN backend). YOLOv4 weights were downloaded from AlexeyAB/darknet. The classifier is based on MobileNet v3 (Alibaba MNN backend).

Web demo: Vehicle Make and Color Recognition

The full version recognizes the make, model, and color of the vehicles. Here is a web demo to test it: Vehicle Make and Model Recognition

Object Detection and Classification in images

This example takes an image as input, detects the cars using YOLOv4 object detector, crops the car images, resizes them to the input size of the classifier, and recognizes the brand of each car. The result is shown on the display and saved as output.jpg image file.


Use --help to see usage of

$ python --image cars.jpg
$ python [-h] [--yolo MODEL_PATH] [--confidence CONFIDENCE] [--threshold THRESHOLD] [--image]

required arguments:
  -i, --image              path to input image

optional arguments:
  -h, --help               show this help message and exit
  -y, --yolo MODEL_PATH    path to YOLO model weight file, default yolo-coco
  --confidence CONFIDENCE  minimum probability to filter weak detections, default 0.5
  --threshold THRESHOLD    threshold when applying non-maxima suppression, default 0.3


pip install numpy

pip install opencv-python

pip install MNN

If you use Windows, the OpenCV package is recommended to be installed from:

yolov4.weights must be downloaded from and saved in folder yolov4


The examples are based on the tutorial by Adrian Rosebrock: YOLO object detection with OpenCV

The YOLOv4 object detector is from:

  title={YOLOv4: Optimal Speed and Accuracy of Object Detection},
  author={Bochkovskiy, Alexey and Wang, Chien-Yao and Liao, Hong-Yuan Mark},
  journal={arXiv preprint arXiv:2004.10934},

The car brand classifier is based on MobileNetV3 mobile architecture: Searching for MobileNetV3

  title={Searching for mobilenetv3},
  author={Howard, Andrew and Sandler, Mark and Chu, Grace and Chen, Liang-Chieh and Chen, Bo and Tan, Mingxing and Wang, Weijun and Zhu, Yukun and Pang, Ruoming and Vasudevan, Vijay and others},
  booktitle={Proceedings of the IEEE International Conference on Computer Vision},

The runtime library of the classifier is MNN

  author = {Jiang, Xiaotang and Wang, Huan and Chen, Yiliu and Wu, Ziqi and Wang, Lichuan and Zou, Bin and Yang, Yafeng and Cui, Zongyang and Cai, Yu and Yu, Tianhang and Lv, Chengfei and Wu, Zhihua},
  title = {MNN: A Universal and Efficient Inference Engine},
  booktitle = {MLSys},
  year = {2020}

Author View Profile

Sofia, Bulgaria
Level 9 8800 XP

204 Profile

User Reviews

0 total ratings

Model has not been reviewed yet.

More by this user | Show All

Also checkout...