Last active
May 13, 2020 02:01
-
-
Save p3jitnath/9c048952057f6275b1b2b3e93ec886dd to your computer and use it in GitHub Desktop.
Google Cloud Configuration to train YOLO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
classes=80 | |
train=coco/trainvalno5k.txt | |
valid=coco/testdev2017.txt | |
names=data/coco.names | |
backup=backup/ | |
eval=coco |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CHANGE THE FOLLOWING TWO LINES | |
sudo nano /etc/ssh/sshd_config | |
# PubkeyAuthentication yes --> no | |
# PasswordAuthentication no --> yes | |
# CHANGE YOUR PASSWORD | |
sudo adduser user | |
sudo usermod -a -G sudo user | |
sudo systemctl restart sshd | |
# [LOGOUT] | |
sudo reboot | |
##### OPENCV CONFIGURATION 18.04 LTS CPU ##### | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install build-essential cmake unzip pkg-config | |
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev | |
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" | |
sudo apt update | |
sudo apt install libjasper1 libjasper-dev | |
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev | |
sudo apt-get install libxvidcore-dev libx264-dev | |
sudo apt-get install libgtk-3-dev | |
sudo apt-get install libatlas-base-dev gfortran | |
sudo apt-get install python3.6-dev | |
cd ~ | |
wget -O opencv.zip https://github.com/opencv/opencv/archive/3.4.4.zip | |
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.4.4.zip | |
unzip opencv.zip | |
unzip opencv_contrib.zip | |
mv opencv-3.4.4 opencv | |
mv opencv_contrib-3.4.4 opencv_contrib | |
wget https://bootstrap.pypa.io/get-pip.py | |
sudo python3 get-pip.py | |
sudo pip install virtualenv virtualenvwrapper | |
sudo rm -rf ~/get-pip.py ~/.cache/pip | |
export WORKON_HOME=$HOME/.virtualenvs | |
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 | |
source /usr/local/bin/virtualenvwrapper.sh | |
echo -e "\n# virtualenv and virtualenvwrapper" >> ~/.bashrc | |
echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.bashrc | |
echo "export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3" >> ~/.bashrc | |
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc | |
source ~/.bashrc | |
mkvirtualenv cv -p python3 | |
workon cv | |
pip install numpy | |
workon cv | |
cd ~/opencv | |
mkdir build | |
cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D WITH_CUDA=OFF \ | |
-D INSTALL_PYTHON_EXAMPLES=ON \ | |
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ | |
-D OPENCV_ENABLE_NONFREE=ON \ | |
-D BUILD_EXAMPLES=ON .. | |
make -j16 | |
sudo make install | |
sudo ldconfig | |
pkg-config --modversion opencv | |
ls /usr/local/python/cv2/python-3.6 | |
cd /usr/local/python/cv2/python-3.6 | |
sudo mv cv2.cpython-36m-x86_64-linux-gnu.so cv2.so | |
cd ~/.virtualenvs/cv/lib/python3.6/site-packages/ | |
ln -s /usr/local/python/cv2/python-3.6/cv2.so cv2.so | |
cd /usr/local/lib/python3.6/dist-packages | |
sudo ln -s /usr/local/python/cv2/python-3.6/cv2.so cv2.so | |
cd ~ | |
rm opencv.zip opencv_contrib.zip | |
rm -rf opencv opencv_contrib | |
##### END OPENCV CONFIGURATION CPU ##### | |
##### DOWNLOAD DARKNET ##### | |
git clone https://github.com/AlexeyAB/darknet | |
##### DOWNLOAD COCO ##### | |
cd darknet | |
source scripts/get_coco_dataset.sh | |
cd .. | |
wget http://images.cocodataset.org/zips/test2017.zip | |
unzip test-dev2017 | |
mv test2017 coco/ | |
cd coco/ | |
wget https://gist.githubusercontent.com/nathzi1505/6189e64be9a61869f4dd4f4c4d5c6122/raw/dc7c9f89f614f3318a0088063f2de57d91033c54/testdev2017.txt | |
cd .. | |
##### COMPILE DARKNET ##### | |
make | |
##### TRAIN YOLO ON COCO ##### | |
./darknet detector train cfg/coco.data cfg/yolov4.cfg -dont_show -mjpeg_port 8090 -map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment