└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Google Colab Tutorial 2 | 3 | Colab is a Google’s free cloud service which will let you run your deep learning or machine learning models in cloud. 4 | 5 | ### Creating New Colab Notebook 6 | 7 | * Open your Google Drive 8 | * Create a new notebook via Right click > More > Colaboratory 9 | 10 | ### GPU Setting 11 | 12 | Edit > Notebook settings or Runtime>Change runtime type and select GPU as Hardware accelerator 13 | 14 | ### RAM Info 15 | ``` 16 | !cat /proc/meminfo 17 | ``` 18 | 19 | ### CPU Info 20 | 21 | ``` 22 | !cat /proc/cpuinfo 23 | ``` 24 | 25 | ### Install Libraries 26 | 27 | !pip install or !apt-get install 28 | 29 | ``` 30 | !pip3 install tensorflow==1.8 31 | !pip3 install keras 32 | !pip3 install torch torchvision 33 | !apt-get install python-numpy python-scipy 34 | ``` 35 | ### Install OpenCV for c/c++ 36 | 37 | ``` 38 | !apt-get install -qq gcc-5 g++-5 -y 39 | !ln -s /usr/bin/gcc-5 40 | !ln -s /usr/bin/g++-5 41 | 42 | !sudo apt-get update 43 | !sudo apt-get upgrade 44 | 45 | #Install Dependencies 46 | !sudo apt-get install -y build-essential 47 | !sudo apt-get install -y cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev 48 | #The following command is needed to process images: 49 | !sudo apt-get install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev 50 | #To process videos: 51 | !sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev 52 | !sudo apt-get install -y libxvidcore-dev libx264-dev 53 | #For GUI: 54 | !sudo apt-get install -y libgtk-3-dev 55 | #For optimization: 56 | !sudo apt-get install -y libatlas-base-dev gfortran pylint 57 | !wget https://github.com/opencv/opencv/archive/3.4.0.zip -O opencv-3.4.0.zip 58 | !sudo apt-get install unzip 59 | !unzip opencv-3.4.0.zip 60 | %cd opencv-3.4.0 61 | !mkdir build 62 | %cd build 63 | !cmake -D WITH_TBB=ON -D WITH_OPENMP=ON -D WITH_IPP=ON -D CMAKE_BUILD_TYPE=RELEASE -D BUILD_EXAMPLES=OFF -D WITH_NVCUVID=ON -D WITH_CUDA=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CSTRIPES=ON -D WITH_OPENCL=ON CMAKE_INSTALL_PREFIX=/usr/local/ .. 64 | !make -j`nproc` 65 | !sudo make install 66 | 67 | ``` 68 | ### Cloning Github Repo to Google Colab 69 | 70 | ``` 71 | !git clone https://github.com/ildoonet/tf-pose-estimation.git 72 | ``` 73 | ### Mount your Google Drive 74 | 75 | ``` 76 | from google.colab import drive 77 | drive.mount('/content/drive/') 78 | ``` 79 | 80 | ### Check your Folder Data 81 | 82 | ``` 83 | !ls Drive/test 84 | ``` 85 | 86 | ### Upload code from your system 87 | 88 | ``` 89 | from google.colab import files 90 | uploaded = files.upload() 91 | ``` 92 | ### Make zip file of your Data 93 | 94 | ``` 95 | from google.colab import files 96 | import zipfile 97 | import sys 98 | foldername = 'your folder or filename' 99 | zipfile.ZipFile('Drive/'+foldername + '.zip', 'w', zipfile.ZIP_DEFLATED) 100 | ``` 101 | 102 | ### Downloading the data from the colab 103 | 104 | ``` 105 | from google.colab import files 106 | files.download('Drive/test.zip') 107 | ``` 108 | --------------------------------------------------------------------------------