Giter VIP home page Giter VIP logo

vehicle-distance-estimation's Introduction

Vehicle Distance Estimation

The project is about vehicle object detection & distance estimation using thermal imaging.

The main idea is to make object detection using Yolov5 after fine-tuning it on the FLIR dataset to enable the model to accurately detect objects on thermal images and videos. Then using object detection results as an input to the distance estimation model - trained on the KITTI dataset - we estimate the distance. Finally, we visualize predictions.

distance_estimation_sample

Usage

Object Detection

Detect objects on images/video frames.

Setup

  • clone repo git clone https://github.com/RmdanJr/vehicle-distance-estimation.git
  • navigate to object detector directory cd vehicle-distance-estimation/object-detector/
  • install requirements pip install -r requirements.txt
  • setup environment python setup.py

Training

Dataset
  • download dataset bash scripts/download-flir-dataset.sh
  • format dataset as YOLOv5 format python format-dataset.py
Fine-tuning YOLOv5s
  • create YAML configuration file python create-yaml.py
  • modify yolovs YAML file python configure-yolo-yaml.py
  • train model on our custom dataset python train.py --epochs 50 --data dataset.yaml --cfg yolov5s.yaml

Detection

make detections on images/videoes using our training weights.

  • download our pre-trained model's weights gdown --folder 10jpVGSHGILDt85QGf5KwHji0sUjZXbWR
  • detect objects on input video python detect.py --save-txt --weights training-results/weights/best.pt --conf 0.4 --source video.mp4

Generate Objects Coordinates Sheet

Frames on rows & classes on columns. Each cell has all center coordinates of the detected objects in a frame on a row from class on a column.

  • generate sheet from text labels python generate-coordinates-sheet.py

Distance Estimation

Estimate the distance of objects using object detection results.

Setup

  • navigate to distance estimator directory cd vehicle-distance-estimation/distance-estimator/
  • install requirements pip install -r requirements.txt

Training

Dataset
  • download dataset bash scripts/download-kitti-dataset.sh
  • format dataset bash scripts/organize-dataset-format.sh
Generate CSV File
  • generate train and test csv files from dataset annotations python generate-csv.py --input=kitti-dataset/train_annots/ --filename=annotations.csv --results .
Train Model
  • continue training a pre-trained model python training_continuer.py --model models/[email protected] --weights models/[email protected] --results models/ --train train.csv --test test.csv

OR

  • train model from scratch python train.py --results models/ --train train.csv --test test.csv

Estimation

  • estimate distance python inference.py --data annotations.csv --model models/[email protected] --weights models/[email protected] --results .
  • visualize predections python visualizer.py --data ../results/data/data.csv --frames ../object-detector/results/frames/ -fps 90 --results results

Appendices

vehicle-distance-estimation's People

Contributors

ahmedabdelalem61 avatar engahmedelkady avatar rmdanjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vehicle-distance-estimation's Issues

train.csv & test csv not available

train.csv & test csv not available .only csv-generator.py is there ,there is no function of splitting that csv into train.csv and test.csv

train.csv and test.csv

Hello
I have a problem about distance estimation.
After i use ' python generate-csv.py --input=kitti-dataset/train_annots/ --filename=annotations.csv --results . ' i only got an annotations.csv.
In the step of Train Model, where are train.csv and test.csv obtained from?

Thank!

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.