Skip to content

zoumson/LaneDetectionDNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Detection of object in a image/video and image classification

(on going) lane_detection

Table of Contents
  1. About The Project
  2. Files Structure
  3. Getting Started
  4. Usage
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgements

About The Project

Image Classification is a fundamental task that attempts to comprehend an entire image as a whole. The goal is to classify the image by assigning it to a specific label. Typically, Image Classification refers to images in which only one object appears and is analyzed. In contrast, object detection involves both classification and localization tasks, and is used to analyze more realistic cases in which multiple objects may exist in an image.

A list of commonly used resources that I find helpful are listed in the acknowledgements.

Built With



File Structure

Folders

  • build/: Running cmake .. and make.
  • include/: c++ header files.
  • lib/: c++ custom libraries.
  • resource/: input images and video, deep neural network configuration files.
  • result/: output images and video.
  • src/: c++ definitions.

Entire Files Structure

.
├── build
├── CMakeLists.txt
├── include
│   └── ClassifyDetect.hpp
├── lib
├── README.md
├── ressource
│   ├── image
│   │   ├── image_1.jpg
│   │   └── image_2.jpg
│   ├── txt
│   │   ├── classification_classes_ILSVRC2012.txt
│   │   ├── DenseNet_121.caffemodel
│   │   ├── DenseNet_121.prototxt
│   │   ├── frozen_inference_graph.pb
│   │   ├── object_detection_classes_coco.txt
│   │   └── ssd_mobilenet_v2_coco_2018_03_29.pbtxt.txt
│   └── video
│       └── video_1.mp4
├── result
│   ├── image
│   │   └── imgOutC.jpg
│   └── video
│       └── video_result.avi
└── src
    ├── ClassifyDetect.cpp
    └── Main.cpp

11 directories, 16 files


Getting Started

This is a sample code of how you may detect a lane on a road while driving autonomous vehicle. To get a local copy up and running follow these simple steps.

Prerequisites

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

  • cmake
    sudo apt-get install cmake
  • CPP standard: CMAKE_CXX_STANDARD 17
  • Install gtk and gtk3 module to access canberra-gtk-module used by opencv imshow
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module

Installation

  1. Install first opencv4 cpp libraries at https://opencv.org/
  2. Clone the repo
    git clone https://github.com/zoumson/LaneDetectionDNN.git
  3. Go to build
    cd ./build
  4. Clear the folder build
    rm -r *
  5. Then run the cmake file to generate the makefile
    cmake ..
  6. Finally run the makefile to generate the executable main
    make

Usage

  1. Command line arguments

Image Classification and Image/Video  detection
Usage: main [params] 

	-?, -h, --help, --usage (value:true)
		show help message
	-c, --classC (value:../ressource/txt/classification_classes_ILSVRC2012.txt)
		classification classes
	--classDI, -l (value:../ressource/txt/object_detection_classes_coco.txt)
		image detection classes
	-e, --nnMC (value:../ressource/txt/DenseNet_121.caffemodel)
		classification config
	-i, --imgInC
		input image path
	--imgOutC, -j (value:../result/image/imgOutC.jpg)
		output classified image
	-m, --modelC (value:caffe)
		classification framework
	--modelDI, -r (value:TensorFlow)
		image detection framework
	-n, --nnPC (value:../ressource/txt/DenseNet_121.prototxt)
		classification model
	--nnMDI, -q (value:../ressource/txt/ssd_mobilenet_v2_coco_2018_03_29.pbtxt.txt)
		image detection config
	--nnPDI, -p (value:../ressource/txt/frozen_inference_graph.pb)
		image detection model
	-o, --option (value:<none>)
		1 image classification, 2 image detection, 3 video detection
	-t, --videoOut (value:../result/video/video_result.avi)
		output detected video path
	-v, --videoIn
		input video path


  1. Run an image classification with an image in ressource/image
./main -o=1 -i=../ressource/image/image_1.jpg
  1. Run an image detection with an image in ressource/image
./main -o=2 -i=../ressource/image/image_2.jpg
  1. Run a video detection with a video in ressource/video
./main -o=3 -i=../ressource/video/video_1.mp4

Roadmap

All the headers files are well docummented, read through the comments

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Adama Zouma - - stargue49@gmail.com

Project Link: https://github.com/zoumson/LaneDetectionDNN

Acknowledgements

About

Detect lanes on a road

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published