Giter Site home page Giter Site logo

yolov8-for-kitti-benchmark's Introduction

YOLOv8 for KITTI Benchmark

๐Ÿš€ Supercharge your Object Detection on KITTI with YOLOv8!

Welcome to the YOLOv8_KITTI project. This repository is dedicated to training and fine-tuning the state-of-the-art YOLOv8 model specifically for KITTI dataset, ensuring superior object detection performance.

Installation

Set up the python environment

conda create -n yolov8 python=3.8
conda activate yolov8
pip install -r requirements.txt

Set up datasets

1. Set up workspace

Download KITTI dataset and add a link to the data directory. Your datasets path is the disk directory that stores datasets and your project path is current path.

ln -s /your/datasets/path/KITTI/data_object_image_2 /your/project/path/data

After preparation, you should have the following directory structure:

data/data_object_image_2
|-- training
|   |-- image_2
|   |-- label_2
|-- testing
|   |-- image_2
......

2. Generate YOLO training label format

We need to modify the original data format to a format suitable for yolov8 training. It will create a labels_clean folder, which contains the label files we need.

python generate_kitti_4_yolo.py

NOTE: I remove some object labels that didn't meet the conditions, such as the height was too small, the truncation was too serious, the occlusion was too serious, etc.

3. Generate YOLO train/valid file

I handled the training data in advance is divided into about 50% training set and 50% validation set, and is stored in kitti_splits folder. Use the following command to generate the files we need in training.

python main.py --type preprocess

After this, we will get a train folder containing training images and labels. A valid folder containing valid images and labels. A kitti.yaml file used for yolov8 training configuration file. A kitti_classes.json file containing Object classes and indexs.

4. Trained model

Download the trained model from YOLOV8-KITTI (Pretrained on yolov8x.pt) if you need.

Put it into ./best.pt.

Training and Evaluation, etc

Training

Use the following command to train a object detection model on KITTI. It will download some pretrained model(yolov8x.pt), please wait a minute.

python main.py --type train

After trained, it will create a yolov8x-kitti-clean folder, which contained the training models and some information files.

Fine-tuning for 50 epoch and 9 batch-size takes about 100 minutes, on our test machine (i5-13600KF CPU, RTX 4070 GPU).

Evaluation

Use the following command to evaluate a object detection model on KITTI. You can download the trained model from this section.

python main.py --type evaluate --weight your/model/path/best.pt

All result files saved in ./runs/detect/val folder. Following output is the precision, recall, mAP50 and mAP50-95 data on the validation set.

         Class     Images  Instances      Box(P          R      mAP50  mAP50-95):
           all       3769      15018      0.563       0.44      0.447      0.283
           Car       3769      10963       0.77      0.915      0.901      0.695
    Pedestrian       3769       2172      0.749      0.546      0.627      0.303
           Van       3769       1147       0.37      0.234      0.231      0.155
       Cyclist       3769        600      0.493      0.498        0.4       0.23
Person_sitting       3769        136      0.433    0.00735     0.0748     0.0343
Speed: 0.0ms preprocess, 6.0ms inference, 0.0ms loss, 0.3ms postprocess per image
Image 1 Image 2

Prediction

Use the following command to predict the test set on KITTI using the trained model. You can download the trained model from this section.

python main.py --type predict --weight your/model/path/best.pt

All result images and labels saved in ./runs/detect/predict folder.

Export

Use the following command to export the TensorRT model. You can download the trained model from this section.

python main.py --type export --weight your/model/path/best.pt

Will get the result model, such as best.onnx and best.engine.

Citation

For additional resources and information, please see the links below:

yolov8-for-kitti-benchmark's People

Contributors

command-z-z avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.