Table of Contents
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.
- build/: Running
cmake ..
andmake
. - 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.
.
├── 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
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.
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
andgtk3
module to accesscanberra-gtk-module
used byopencv imshow
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module
- Install first
opencv4
cpp libraries at https://opencv.org/ - Clone the repo
git clone https://github.com/zoumson/LaneDetectionDNN.git
- Go to build
cd ./build
- Clear the folder
build
rm -r *
- Then run the cmake file to generate the makefile
cmake ..
- Finally run the makefile to generate the executable
main
make
- 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
- Run an image classification with an image in
ressource/image
./main -o=1 -i=../ressource/image/image_1.jpg
- Run an image detection with an image in
ressource/image
./main -o=2 -i=../ressource/image/image_2.jpg
- Run a video detection with a video in
ressource/video
./main -o=3 -i=../ressource/video/video_1.mp4
All the headers files are well docummented, read through the comments
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Adama Zouma - - stargue49@gmail.com
Project Link: https://github.com/zoumson/LaneDetectionDNN