Table of Contents
This repository holds the code for our 2D vehicle classification model, a key part of our Real-Time Traffic Management (RTTM) system. To explore the full RTTM project, check out the provided links:
This is an example of how you can download and use the model
This is an example of how to list things you need to use the software and how to install them.
pip install ultralytics
- Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services._
-
Download Model From:
git clone https://github.com/your_username_/Project-Name.git -
Install Ultralytics packages
pip install ultralytics
-
Import Library
from ultralytics import YOLO
-
Load Pretrained Model (The model you downloaded previously)
model_path = 'path/to/model' model = YOLO(model_path)
-
Run Inference on a image
image_path = 'path/to/image.png" model.predict(image_path, save=True, imgsz=320, conf=0.5)
-
Run Inference using webcam
model.predict(source = "0", save=True, imgsz=320, conf=0.5)
-
For more Details check the documentation: Documentation
The project aims to classify vehicles in real-time from a 2D video stream.
For more examples, please refer to the complete project repository rttm.
Robin Rosculete - linkedin - [email protected]
.
├── Configuration-Files # Directory consisting of both testing and training configuration files.
│ ├── config_test.yaml # Config file for testing. Testing data is set as the validation to enable the use of model.val() for testing on new data.
│ └── config_train.yaml # Config file for training and validation during training.
├── images # Images used in the readme.md file
│ ├── logo.png
│ └── screenshot.png
├── model # Directory holding the models obtained after training the YoloV8 model on our data
│ ├── Newest-YoloV8-2D-Vehicle-Classification-Model.pt # Model trained on the dataset collected and labeled in 2023 - 2024
│ └── Old-YoloV8-2D-Vehicle-Classification-Model.pt # Model trained on the dataset collected and labeled in 2022 - 2023
├── notebooks # Directory holding the notebooks
│ ├── runs/detect # Results from training, validation, and testing the model
│ │ ├── train # Training and validation (during training) result in images and also weights of the last trained model
│ │ │ ├── weights # Model weights after training
│ │ │ │ ├── best.pt # Weights for the model at the best epoch
│ │ │ │ └── last.pt # Weights for the model at the last epoch
│ │ │ ├── ... # Files and images consisting of results from training and validation
│ │ ├── val # Results from testing the model on new data, it is called val because of the model.val() was used as a workaround for testing with a different config file
│ │ │ └── ... # Files and images consisting of results from testing the model
│ ├── AutoLabeling.ipynb # Notebook containing the Autolabeling code used to label new data
│ ├── Extract-Frames.ipynb # Notebook containing code for breaking collected video data into frames
│ └── vehicle-classification-using-yolo-v8.ipynb # Notebook containing the code for both training and testing code (main notebook of model)
├── .gitignore
└── README.md