Skip to content

Instantly share code, notes, and snippets.

@YaYaB
Last active March 3, 2020 09:25
Show Gist options
  • Save YaYaB/7d5b117d4a9976b73201f7fb28eaae95 to your computer and use it in GitHub Desktop.
Save YaYaB/7d5b117d4a9976b73201f7fb28eaae95 to your computer and use it in GitHub Desktop.
This script allows to automate installation of DeepDetect (https://www.deepdetect.com/)
# This is for Ubuntu 18.04, 16.04, 14.04
# Make sure Nvidia Drivers, cuda and cudnn are well installed in the machine on which you want to install DeepDetect
# Prefer cuda 10.1 instead of cuda 10.2 (cuda 10.2 is not well supported).
# https://www.deepdetect.com/
# Install dependencies based on version of ubuntu
unbuntu_version=$(echo "$(lsb_release -r)" | cut -f2 | cut -d '.' -f1)
if [ $unbuntu_version = 18 ]
then
# Prepare temp folder
cd ${HOME}
mkdir temp
cd temp
# Install cmake
wget https://github.com/Kitware/CMake/releases/download/v3.14.0/cmake-3.14.0.tar.gz
tar xvzf cmake-3.14.0.tar.gz
cd cmake-3.14.0
./bootstrap
make
sudo make install
cd ${HOME}/temp
# Install cppnetlib
sudo apt install libssl-dev # need to install openssl
sudo apt-get install libboost-all-dev # need to install boost as well
wget https://github.com/cpp-netlib/cpp-netlib/archive/cpp-netlib-0.11.2-final.tar.gz
tar xvzf cpp-netlib-0.11.2-final.tar.gz
cd cpp-netlib-cpp-netlib-0.11.2-final
mkdir build
cd build
cmake ..
make
sudo make install
# Remove temp folder
cd ${HOME}
rm -rf temp
# Install DD dependencies
sudo apt-get install build-essential libgoogle-glog-dev libgflags-dev libeigen3-dev libopencv-dev libboost-iostreams-dev libcurlpp-dev libcurl4-openssl-dev protobuf-compiler libopenblas-dev libhdf5-dev libprotobuf-dev libleveldb-dev libsnappy-dev liblmdb-dev libutfcpp-dev cmake libgoogle-perftools-dev unzip python-setuptools python-dev libspdlog-dev python-six python-enum34 libarchive-dev
else
## Install DeepDetect's dependencies
sudo apt-get install build-essential libgoogle-glog-dev libgflags-dev libeigen3-dev libopencv-dev libcppnetlib-dev libboost-dev libboost-iostreams-dev libcurlpp-dev libcurl4-openssl-dev protobuf-compiler libopenblas-dev libhdf5-dev libprotobuf-dev libleveldb-dev libsnappy-dev liblmdb-dev libutfcpp-dev cmake libgoogle-perftools-dev unzip python-setuptools python-dev libspdlog-dev python-six python-enum34 libarchive-dev
fi
## Install DeepDetect
PATH_TO_INSTALL="${HOME}/apps"
mkdir ${PATH_TO_INSTALL}
COMMIT="a68b6c26ee92dbde047d240d3e1506c9732b681a"
DD_FOLDER="${PATH_TO_INSTALL}/deepdetect"
cd ${PATH_TO_INSTALL}
git clone https://github.com/beniz/deepdetect.git
cd ${DD_FOLDER}
git checkout ${COMMIT}
mkdir build
cd build
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
cmake .. -DUSE_CUDNN=ON
##Reinstall libcurlpp - Fix bug Deep Detect
sudo apt-get remove libcurlpp0
cd ${HOME}
git clone https://github.com/jpbarrette/curlpp.git
cd curlpp
cmake .
sudo make install
cd ..
sudo rm -rf curlpp
# Finalize install
cd ${DD_FOLDER}/build
make clean
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment