Skip to content

App to classify vehicles and subclassify trucks according to number of axels 🚗 🚛

License

Notifications You must be signed in to change notification settings

SravanChittupalli/Advanced-Vehicle-Classifier-and-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Advanced-Vehicle-Classifier-And-Tracker 🚗 🚛 🚴🏽 🚍

This project aims at classifying multiple classes of vehicles and in addition to that sub-classifying of trucks according to number of axels.

Contents

Why this project

  • Sub-classification of trucks is a very important task as it has many uses like toll-automation and counting number and type of vehicles accurately. Specially in India all types of trucks look the same untill you are a truck connoisseur but the wear and tear done by different trucks depends on the number of tyres. So each vehicle has to be charged differently.

  • You can also see that at toll gates where it is completely manual the workers can misinform the authorities about the total amount earned for that day thus leading to loss for the authority owning the road. This project can reduce such frauds.

  • Nowadays we find the use of RFID tags for toll automation. The problem with this is every user has to buy one but by using ComputerVision no external hardware is required. Once setup you will get the data automatically 24X7.

About the Project

GUI

The project contains a GUI application to generalise the project. It can be used at toll gates to keep an accurate track of number of vehicles and with addition of some more classes and features the project can also be used for full toll automation. The project uses Darknet YOLOv4 and SORT tracker. For now the app can only classify car , bike , bus and 5 classes of trucks.

Tech Stack

File Structure

├── LICENSE
├── README.md                
├── WORKPLAN.md                       # Project plan
├── Code/
│   ├── GUIApp.py                     # GUI APP
│   ├── SortTracker.py                # SortImplementation
│   ├── classify_track_count.py       # YOLO classifier
|   ├── requirements.txt              # All required libraries
│   ├── extras            
│      |-- coco.data           
|      |-- coco.names
|      |-- multi_classify.cfg
|      |-- multi_classify.data
|      |-- multi_classify.names
│      |-- yolov4.cfg         
|   |-- media/Pics_Readme
|      |-- GUI.png
|      |-- fulldemo.gif

How to run the application

This is the problem with darknet. I can't find a way to give the whole project as a package along with darknet. Please do the following steps extremely carefully.

  1. Clone AlexyAB's darknet github repo.
  2. Run the python demo as given in the README. If you built and ran the demo successfully then continue to step 3
  3. Clone this repo into the darknet folder
  4. Next copy the 3 python files in Code folder into the darknet folder
  5. Copy the .data and .names files in Code/extras to darknet/data folder.
  6. Copy the .cfg files in Code/extras to darknet/cfg folder.
  7. Download the weight files from the drive link and save them in darknet folder. There will also be a sample_videos folder also place it anywhere you want.
  8. Open a terminal and run pip install -r requirements.txt. I strongly recommend the use of miniconda as is keep the system python packages seperate, thus avoiding conflict.
  9. Now you are all set to run the demo. Activate your environment and run python GUIApp.py.
  10. Select the sample video and choose the ROI as shown in the GIF below. Detection of axels requires specific angles so I recommend using the ROI as (444,191), (1440,734) to get the best results.

Just to make your life easier i've added a bash script that you can run to do everything from step 4 to step 6

Demo

WORKING DEMO

To-Do

I've tried this project using feature extraction , Hough Circle detection , Finding area and length of truck , counting each wheel individually but atlast ended up using 2 iterations of the neural network on 2 different weights one which classifies vehicles and the other that detects wheels 😅. I understand that this is not an efficient method but I did not have enough resources to make a whole dataset by myself which includes cars, trucks , bikes , buses along with their wheels. Also I could not find many videos with trck , car facing to the side so that I can detect wheels easily. If anyone has any sugestions on solving this problem efficintly them please open an issue I will be more than happy to try and implement the suggestions or else you can even try to implement it on your own. 😄

  • Add script to ensure smooth running
  • increase # of classes
  • add number plate recognition
  • increase efficiency

References

License

Details can be found in License.

About

App to classify vehicles and subclassify trucks according to number of axels 🚗 🚛

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published