Skip to content

CalTransProject/2D-Vehicle-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

YoloV8-2D-Vehicle-Classification-Model

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact
  5. Acknowledgments

About The Project

Product Name Screen Shot

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:

(back to top)

Built With

  • Logo
  • Logo

(back to top)

Getting Started

This is an example of how you can download and use the model

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

pip install ultralytics

Installation

  • 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._
  1. Download Model From:
    git clone https://github.com/your_username_/Project-Name.git

  2. Install Ultralytics packages

    pip install ultralytics
  3. Import Library

    from ultralytics import YOLO
  4. Load Pretrained Model (The model you downloaded previously)

    model_path = 'path/to/model'
    model = YOLO(model_path)
  5. Run Inference on a image

    image_path = 'path/to/image.png"
    model.predict(image_path, save=True, imgsz=320, conf=0.5)
  6. Run Inference using webcam

    model.predict(source = "0", save=True, imgsz=320, conf=0.5)
  7. For more Details check the documentation: Documentation

(back to top)

Usage

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.

(back to top)

Contact

Robin Rosculete - linkedin - [email protected]

(back to top)

File Structure

   .
    ├── 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

(back to top)

Acknowledgments

(back to top)

About

This is the GirHub Repo for YoloV8 model for 2D Vehicle Detection and Classification

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published