|
| 1 | +# DetectionSuite |
| 2 | + |
| 3 | +[](https://travis-ci.org/JdeRobot/dl-DetectionSuite) |
| 4 | + |
| 5 | +DetectionSuite is a DeepLearning tool that simplifies the evaluation of most common object detection datasets with several object detection neural networks. |
| 6 | + |
| 7 | +The idea is to offer a generic infrastructure to evaluates object detection algorithms againts a dataset and compute most common statistics: |
| 8 | +* Intersecion Over Union |
| 9 | +* Precision |
| 10 | +* Recall |
| 11 | + |
| 12 | +#### Supported Operating Systems: |
| 13 | +* Linux |
| 14 | +* MacOS |
| 15 | + |
| 16 | + |
| 17 | +##### Supported datasets formats: |
| 18 | +* YOLO |
| 19 | +* COCO |
| 20 | +* ImageNet |
| 21 | +* Pascal VOC |
| 22 | +* Jderobot recorder logs |
| 23 | +* Princeton RGB dataset [1] |
| 24 | +* Spinello dataset [2] |
| 25 | + |
| 26 | +##### Supported object detection frameworks/algorithms |
| 27 | +* YOLO (darknet) |
| 28 | +* TensorFlow |
| 29 | +* Keras |
| 30 | +* Caffe |
| 31 | +* Background substraction |
| 32 | + |
| 33 | +##### Supported Inputs for Deploying Networks |
| 34 | +* WebCamera/ USB Camera |
| 35 | +* Videos |
| 36 | +* Streams from ROS |
| 37 | +* Streams from ICE |
| 38 | +* JdeRobot Recorder Logs |
| 39 | + |
| 40 | + |
| 41 | +## Sample generation Tool |
| 42 | +Sample Generation Tool has been developed in order to simply the process of generation samples for datasets focused on object detection. The tools provides some features to reduce the time on labelling objects as rectangles. |
| 43 | + |
| 44 | + |
| 45 | +# Installation |
| 46 | +#### We have AppImages !!! |
| 47 | +### [Download from here](https://github.com/vinay0410/dl-DetectionSuite/releases/tag/continuous) |
| 48 | + |
| 49 | + |
| 50 | +To run, |
| 51 | +First give executable permissions by running |
| 52 | +`chmod a+x DetectionSuitexxxxx.AppImage` |
| 53 | +And Run it by |
| 54 | +`./DetectionSuitexxxxx -c configFile` |
| 55 | + |
| 56 | + |
| 57 | +Though you would need `python` in your system installed with `numpy`. |
| 58 | +Also, for using TensorFlow, you would need to tensorflow, and similaraly for keras you would need to install Keras. |
| 59 | + |
| 60 | +If required they can be installed by |
| 61 | +``` |
| 62 | +pip install tensorflow |
| 63 | +``` |
| 64 | +or |
| 65 | + |
| 66 | +``` |
| 67 | +pip install tensorflow-gpu |
| 68 | +``` |
| 69 | +Similrarly for keras: |
| 70 | +``` |
| 71 | +pip install keras |
| 72 | +``` |
| 73 | + |
| 74 | +#### Using Docker |
| 75 | +First you need to have docker installed in your computer. If no, assuming you are in Ubuntu, install using the following command |
| 76 | + |
| 77 | +``` |
| 78 | + sudo apt install docker.io |
| 79 | +``` |
| 80 | + |
| 81 | +Now you need to start the docker deamon using |
| 82 | +``` |
| 83 | +sudo service docker start |
| 84 | +``` |
| 85 | + |
| 86 | +After starting the deamon , get the dl-detectionsuite docker file using |
| 87 | +``` |
| 88 | +sudo docker pull jderobot/dl-detectionsuite |
| 89 | +``` |
| 90 | + |
| 91 | +Now run the docker image using |
| 92 | +``` |
| 93 | +sudo docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix jderobot/dl-detectionsuite |
| 94 | +``` |
| 95 | +where the ```-it``` flag instructs Docker to allocate a pseudo-TTY connected to the container’s stdin; creating an interactive ```bash``` shell in the container ,```-e``` tag is used to set the environment variable, in this case ```DISPLAY```, this is required because you will be using GUI for interaction through out rest of the tutorials. |
| 96 | +Voila!! You can now use dl-detectionsuite. Proceed to [beginner's tutorial](https://github.com/JdeRobot/dl-DetectionSuite/wiki/Beginner's-Tutorial-to-DetectionSuite-Part-1) to get started. |
| 97 | + |
| 98 | +# Compile and Install from source |
| 99 | +To use the latest version of dl-DetectionSuite you need to compile and install it from source. |
| 100 | +To get started you can either read along or follow [these video tutorials](https://www.youtube.com/watch?v=HYuFFTnEn5s&list=PLgB5c9xg9C91DJ30WFlHfHAhMECeho-gU). |
| 101 | +## Requirements |
| 102 | + |
| 103 | +### Common deps |
| 104 | + |
| 105 | + |
| 106 | +<table> |
| 107 | +<tr> |
| 108 | +<td> |
| 109 | +<center><b>Ubuntu</b></center> |
| 110 | +</td> |
| 111 | +<td> |
| 112 | +<center><b>MacOS</b></center> |
| 113 | +</td> |
| 114 | +</tr> |
| 115 | +<tr> |
| 116 | +<td> |
| 117 | +<pre> |
| 118 | +sudo apt install build-essential git cmake rapidjson-dev libssl-dev |
| 119 | +sudo apt install libboost-dev libboost-filesystem-dev libboost-system-dev libboost-program-options-dev |
| 120 | +</pre> |
| 121 | +</td> |
| 122 | +<td> |
| 123 | +<pre> |
| 124 | +sudo easy_install numpy |
| 125 | +brew install cmake boost rapidjson |
| 126 | +</pre> |
| 127 | +</td> |
| 128 | +</tr> |
| 129 | +<tr> |
| 130 | +<td> |
| 131 | +<pre> |
| 132 | +sudo apt install libgoogle-glog-dev libyaml-cpp-dev qt5-default libqt5svg5-dev |
| 133 | +</pre> |
| 134 | +</td> |
| 135 | +<td> |
| 136 | +<pre> |
| 137 | +brew install glog yaml-cpp qt |
| 138 | +</pre> |
| 139 | +<br/> |
| 140 | +Also, just add qt in your PATH by running:<br/> |
| 141 | +<pre> |
| 142 | +echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile |
| 143 | +</pre> |
| 144 | +</td> |
| 145 | +</tr> |
| 146 | +<tr> |
| 147 | +<td> |
| 148 | +Install OpenCV 3.4 |
| 149 | +<pre> |
| 150 | +git clone https://github.com/opencv/opencv.git |
| 151 | +cd opencv |
| 152 | +git checkout 3.4 |
| 153 | +mkdir build && cd build |
| 154 | +cmake -D WITH_QT=ON -D WITH_GTK=OFF .. |
| 155 | +make -j4 |
| 156 | +sudo make install |
| 157 | +</pre> |
| 158 | +</td> |
| 159 | +<td> |
| 160 | +<pre> |
| 161 | +brew install opencv |
| 162 | +</pre> |
| 163 | + |
| 164 | +</td> |
| 165 | +</tr> |
| 166 | +</table> |
| 167 | + |
| 168 | +<!-- |
| 169 | +### Opencv |
| 170 | +``` |
| 171 | +sudo apt-get install libopencv-dev |
| 172 | +
|
| 173 | +``` |
| 174 | +
|
| 175 | +### Dependencies (Currently being refined and reduced) |
| 176 | +
|
| 177 | +``` |
| 178 | + sudo apt-get install -y libboost-filesystem-dev libboost-system-dev libboost-thread-dev libeigen3-dev libgoogle-glog-dev \ |
| 179 | + libgsl-dev libgtkgl2.0-dev libgtkmm-2.4-dev libglademm-2.4-dev libgnomecanvas2-dev libgoocanvasmm-2.0-dev libgnomecanvasmm-2.6-dev \ |
| 180 | + libgtkglextmm-x11-1.2-dev libyaml-cpp-dev icestorm zeroc-ice libxml++2.6-dev qt5-default libqt5svg5-dev libtinyxml-dev \ |
| 181 | + catkin libssl-dev |
| 182 | +``` |
| 183 | +--> |
| 184 | +## Optional Dependencies |
| 185 | + |
| 186 | +### CUDA (For GPU support) |
| 187 | + |
| 188 | +``` |
| 189 | + NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \ |
| 190 | +
|
| 191 | + NVIDIA_GPGKEY_FPR=ae09fe4bbd223a84b2ccfce3f60f4b3d7fa2af80 && \ |
| 192 | + sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub && \ |
| 193 | + sudo apt-key adv --export --no-emit-version -a $NVIDIA_GPGKEY_FPR | tail -n +5 > cudasign.pub && \ |
| 194 | + echo "$NVIDIA_GPGKEY_SUM cudasign.pub" | sha256sum -c --strict - && rm cudasign.pub && \ |
| 195 | +
|
| 196 | + sudo sh -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list' && \ |
| 197 | + sudo sh -c 'echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list' |
| 198 | +``` |
| 199 | + |
| 200 | +Update and Install |
| 201 | + |
| 202 | +``` |
| 203 | +sudo apt-get update |
| 204 | +sudo apt-get install -y cuda |
| 205 | +``` |
| 206 | + |
| 207 | +Below is a list of Optional Dependencies you may require depending on your Usage. |
| 208 | + |
| 209 | +* ### Camera Streaming Support |
| 210 | +Detectionsuite can currently read ROS and ICE Camera Streams. So, to enable Streaming support install any one of them. |
| 211 | + |
| 212 | +* ### Inferencing FrameWorks |
| 213 | +DetectionSuite currently supports many Inferencing FrameWorks namely Darknet, TensorFlow, Keras and Caffe. |
| 214 | +Each one of them has some Dependencies, and are mentioned below. |
| 215 | + |
| 216 | + Choose your Favourite one and go ahead. |
| 217 | + |
| 218 | + * #### Darknet (jderobot fork) |
| 219 | + Darknet supports both GPU and CPU builds, and GPU build is enabled by default. |
| 220 | + If your Computer doesn't have a NVIDIA Graphics card, then it is necessary to turn of GPU build in cmake by passing ```-DUSE_GPU=OFF``` as an option in cmake. |
| 221 | + |
| 222 | + ``` |
| 223 | + git clone https://github.com/JdeRobot/darknet |
| 224 | + cd darknet |
| 225 | + mkdir build && cd build |
| 226 | +
|
| 227 | + ``` |
| 228 | + |
| 229 | + For **GPU** users:<br> |
| 230 | + ``` |
| 231 | + cmake -DCMAKE_INSTALL_PREFIX=<DARKNET_DIR> .. |
| 232 | + ``` |
| 233 | + For **Non-GPU** users (CPU build): |
| 234 | + |
| 235 | + ``` |
| 236 | + cmake -DCMAKE_INSTALL_PREFIX=<DARKNET_DIR> -DUSE_GPU=OFF .. |
| 237 | + ``` |
| 238 | + Change ```<DARKNET_DIR>``` to your custom installation path. |
| 239 | + |
| 240 | + ``` make -j4 ``` <br> |
| 241 | + ``` sudo make -j4 install ``` |
| 242 | + |
| 243 | + * #### TensorFlow |
| 244 | + Only depedency for using TensorFlow as an Inferencing framework is TensorFlow. |
| 245 | + So, just install TensorFlow. Though it should be 1.4.1 or greater. |
| 246 | + |
| 247 | + * #### Keras |
| 248 | + Similarly, only dependency for using Keras as an Inferencing is Keras only. |
| 249 | + |
| 250 | + * #### Caffe |
| 251 | + For using Caffe as an inferencing framework, it is necessary to install OpenCV 3.4 or greater. |
| 252 | + |
| 253 | + |
| 254 | +**Note:** Be Sure to checkout the Wiki Pages for tutorials on how to use the above mentioned functionalities and frameworks. |
| 255 | + |
| 256 | +# How to compile DL_DetectionSuite: |
| 257 | + |
| 258 | +Once you have all the required Dependencies installed just: |
| 259 | + |
| 260 | +``` |
| 261 | + git clone https://github.com/JdeRobot/dl-DetectionSuite |
| 262 | + cd dl-DetectionSuite/DeepLearningSuite |
| 263 | + mkdir build && cd build |
| 264 | +``` |
| 265 | +``` |
| 266 | + cmake .. |
| 267 | +``` |
| 268 | +To enable Darknet support with GPU: |
| 269 | +``` |
| 270 | + cmake -DARKNET_PATH=<DARKNET_INSTALLETION_DIR> -DUSE_GPU_DARKNET=ON .. |
| 271 | +``` |
| 272 | +**Note:** GPU support is enabled by default for other Frameworks |
| 273 | +``` |
| 274 | + make -j4 |
| 275 | +
|
| 276 | +``` |
| 277 | + |
| 278 | +**NOTE:** To enable Darknet support just pass an optinal parameter in cmake `-D DARKNET_PATH ` equal to Darknet installation directory, and is same as `<DARKNET_DIR>` passed above in darknet installation. |
| 279 | + |
| 280 | +Once it is build you will find various executables in different folders ready to be executed :smile:. |
| 281 | + |
| 282 | +## Starting with DetectionSuite |
| 283 | +The best way to start is with our [beginner's tutorial](https://github.com/JdeRobot/dl-DetectionSuite/wiki/Beginner's-Tutorial-to-DetectionSuite-Part-1) for DetectionSuite. |
| 284 | +If you have any issue feel free to drop a mail <[email protected]> or create an issue for the same. |
| 285 | + |
| 286 | +## Sample of input and output |
| 287 | + |
| 288 | +<img src="./docs/screen1.png" alt="Screenshot" style="max-width:100%;"> |
| 289 | + |
| 290 | +<img src="./docs/screen2.png" alt="Screenshot" style="max-width:100%;"> |
| 291 | + |
| 292 | +<img src="./docs/screen3.png" alt="Screenshot" style="max-width:100%;"> |
0 commit comments