By: Musa Izzanardi Wijanarko
This project is intended for completing technical test. This Car Retrieval System will be able to detect multiple car instances then classify/retrieve what is the type (eg. MPV, Sedan, Hatchback, etc) of the detected car.
This system consists of two models:
- Car Detection model, using DETR-ResNet50
- Car Body Type Classifier model, using MobilenetV3
The predicted result video can be seen on: ▶ this link
You can also access the technical reports documentation here to see the system architecture, training documentation, etc.
This guide is for UNIX-based OS.
- Python>=3.10.2
- All dependencies are in the
requirements.txt - Ideally a linux-based system, equipped with CUDA (check it with
nvcc --version)
To set this system up, you need to:
- Clone the repo with
git clone - go to the inside of the directory with
cd car-retrieval system - (Optional) create a virtual environment
venvwithpython3 -m venv venv - Activate it with
source venv/bin/activate - Install the required dependencies
pip install -r requirements.txt - You also need to setup a
.envfor these variables:
HF_TOKEN: your huggingface credentialWANDB_PROJECT: project name for tracking in Weight & Biases websiteHF_HOME: huggingface default download path (models, datasets, etc)TORCH_HOME: torch default download pathVIDEO_GDRIVE_ID: the google drive id of test video
This object detection model was based on DETR-ResNet50 with 40M+ parameters, and was trained on the Indian Driving Dataset (Varma et al, 2018) 40K used for object detection task. We will use this dataset since it is resemble the Indonesian road condition.
The dataset has 9 labels and defined as such:
{
"0": "traffic sign",
"1": "motorcycle",
"2": "car",
"3": "rider",
"4": "person",
"5": "truck",
"6": "autorickshaw",
"7": "vehicle fallback",
"8": "bus"
}And we manually convert this dataset into to a CPPE-5-like (YOLO annotation) format and uploaded it into huggingface.
🤗 Huggingface Dataset Link
The classifier model was based on MobileNetV3 available on torch architecture, and then trained on the Stanford Cars dataset introduced by Krause et al. (2015). This dataset does not contains car type, however, mayurmahukar create a mapping to 10 types of car, which are:
{
0: 'Coupe',
1: 'Sedan',
2: 'Cab',
3: 'Convertible',
4: 'SUV',
5: 'Minivan',
6: 'Hatchback',
7: 'Other',
8: 'Van',
9: 'Wagon'
}