Skip to content

Instantly share code, notes, and snippets.

@shinob
Last active October 10, 2017 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinob/73bc33d967ead174a4c17b00269b1aea to your computer and use it in GitHub Desktop.
Save shinob/73bc33d967ead174a4c17b00269b1aea to your computer and use it in GitHub Desktop.
Ubuntu 16.04で機械学習の環境をさくっと作る手順 ref: http://qiita.com/mix_dvd/items/4bf7f6e7fa19068ea1d4
$ sudo apt-get update
$ sudo apt install -y python3 python3-pip python3-dev python3-numpy python3-scipy python3-matplotlib
$ git clone https://github.com/opencv/opencv.git
$ cd opencv
$ git checkout 3.3.0
$ cd ..
$ git clone https://github.com/opencv/opencv_contrib.git
$ cd opencv_contrib
$ git checkout 3.3.0
$ cd ..
$ cd opencv
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
$ make -j4
$ sudo make install
$ sudo ldconfig
$ python3
>>> import cv2
>>> cv2.__version__
'3.3.0'
>>> exit()
$ sudo apt install -y ssh
;[homes]
; read only = yes
$ sudo apt install -y samba
$ sudo smbpasswd -a [ユーザー名]
$ sudo nano /etc/samba/smb.conf
$ sudo /etc/init.d/smbd restart
[global]
dos charset = CP932
unix charset = UTF8
display charset = UTF8
;[homes]
; read only = yes
$ sudo /etc/init.d/smbd restart
[homes]
read only = no
$ sudo /etc/init.d/smbd restart
$ python3 -V
$ python3 -V
Python 3.5.2
$ pip3 -V
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)
$ sudo pip3 install seaborn scikit-learn jupyter xgboost
$ cd
$ mkdir notebook
$ jupyter notebook --generate-config
$ echo "c.NotebookApp.ip = '*'" >> ~/.jupyter/jupyter_notebook_config.py
$ echo "c.NotebookApp.notebook_dir = 'notebook'" >> ~/.jupyter/jupyter_notebook_config.py
$ jupyter --version
4.3.0
$ cd
$ mkdir notebook
$ jupyter notebook --generate-config
$ echo "c.NotebookApp.ip = '*'" >> ~/.jupyter/jupyter_notebook_config.py
$ echo "c.NotebookApp.notebook_dir = 'notebook'" >> ~/.jupyter/jupyter_notebook_config.py
$ jupyter notebook
$ cd
$ wget http://dforest.watch.impress.co.jp/library/i/ipafont/10483/IPAfont00303.zip
$ unzip IPAfont00303.zip
$ sudo mv IPAfont00303/*.ttf /usr/share/matplotlib/mpl-data/fonts/ttf/
$ rm ~/.cache/matplotlib/*.cache
$ sudo apt-get install -y build-essential checkinstall cmake pkg-config yasm gfortran git libjpeg8-dev libjasper-dev libpng12-dev libtiff5-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libv4l-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libqt4-dev libgtk2.0-dev libtbb-dev libatlas-base-dev libfaac-dev libmp3lame-dev libtheora-dev libvorbis-dev libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev x264 v4l-utils libprotobuf-dev protobuf-compiler libgoogle-glog-dev libgflags-dev libgphoto2-dev libeigen3-dev libhdf5-dev doxygen tesseract-ocr tesseract-ocr-jpn libtesseract-dev python3-pyocr libleptonica-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment