| environnement | |
|---|---|
| Ubuntu | 14.04.4 LTS | 
Je veux obtenir un visage à partir d'une image et analyser qui c'est. À cette fin, configurez d'abord l'environnement.
L'analyse vidéo n'est pas effectuée avec OpenCV. Je ne mets donc pas autant que possible des packages liés à la vidéo.
| Quoi mettre | |
|---|---|
| Python | 3.4.3 | 
| OpenCV | 3.0.0 | 
| Chainer | 1.10.0 | 
$ sudo apt-get update
$ sudo apt-get upgrade
$ python -V
$ sudo apt-get install build-essential
$ sudo apt-get install python3-dev
$ python -V
$ python3 -V
$ sudo apt-get install python3-pip
$ pip3 -V
$ pip3 list
$ sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip
$ sudo apt-get -y install build-essential libopenexr-dev python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra default-jdk ant libvtk5-qt4-dev unzip
$ sudo apt-get -y install libdc1394-22-dev libdc1394-22 libdc1394-utils
$ cd ~
$ wget -O opencv-3.0.0.zip https://github.com/Itseez/opencv/archive/3.0.0.zip
$ unzip opencv-3.0.0.zip
$ cd opencv-3.0.0
$ mkdir build
$ cd build
$ sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D INSTALL_PYTHON_EXAMPLES=ON -D PYTHON_EXECUTABLE=$(which python3) -D BUILD_opencv_python3=ON -D BUILD_opencv_python2=ON BUILD_EXAMPLES=ON -D WITH_FFMPEG=OFF -D  BUILD_opencv_java=OFF BUILD_opencv_test_java=OFF ..
   General configuration for OpenCV 3.0.0 =====================================
  
réduction
  
     Python 3:
       Interpreter:                 /usr/bin/python3.4 (ver 3.4.3)
       Libraries:                   /usr/lib/x86_64-linux-gnu/libpython3.4m.so (ver 3.4.3)
       numpy:                       /usr/local/lib/python3.4/dist-packages/numpy/core/include (ver 1.11.1)
       packages path:               lib/python3.4/dist-packages
  
     Python (for build):            /usr/bin/python3
  
réduction
  
     Install path:                  /usr/local
  
     cvconfig.h is in:              /home/ubuntu/opencv-3.0.0/build
   -----------------------------------------------------------------
$ sudo make
$ sudo make install
$ sudo vi /etc/ld.so.conf.d/opencv.conf
  /usr/local/lib
  /usr/lib
$ sudo ldconfig 
$ ldconfig -v
$ python3 -c "import cv2;print(cv2.__version__)" 
$ sudo ln /dev/null /dev/raw1394
$ sudo pip3 install chainer
$ sudo apt-get install python3-numpy python3-scipy
$ sudo pip3 install -U scikit-learn
$ sudo pip3 install matplotlib
$ python3 -c "import chainer;print(chainer.__version__)" 
J'ai été surpris que le Chainer entre très bien. Je vais l'utiliser maintenant.
Recommended Posts