Ubuntu16安装配置openface
1. 安装准备:
sudo apt-get install build-essential-y
sudo apt-get install cmake -y
sudo apt-get install curl -y
sudo apt-get install gfortran -y
sudo apt-get install git -y
sudo apt-get install libatlas-dev -y
sudo apt-get install libavcodec-dev -y
sudo apt-get install libavformat-dev-y
sudo apt-get install libboost-all-dev-y
sudo apt-get install libgtk2.0-dev -y
sudo apt-get install libjpeg-dev -y
sudo apt-get install liblapack-dev -y
sudo apt-get install libswscale-dev -y
sudo apt-get install pkg-config -y
sudo apt-get install python-dev -y
sudo apt-get install python-pip -y
sudo apt-get install wget -y
sudo apt-get install zip -y
2. 安装库
sudo pip2 install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip2 install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip2 install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip2 install scikit-learn -i https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip2 install scikit-image -i https://pypi.tuna.tsinghua.edu.cn/simple
3. 安装torch
git clonehttps://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh
source ~/.bashrc
安装包:
~/torch/install/bin/luarocks installdpnn
~/torch/install/bin/luarocks installnn
~/torch/install/bin/luarocks installoptim
~/torch/install/bin/luarocks installcsvigo
~/torch/install/bin/luarocks installcunn
~/torch/install/bin/luarocks install torchx
~/torch/install/bin/luarocks installgraphicsmagick
~/torch/install/bin/luarocks install cutorch
4. 安装opencv:
mkdir -p src
cd src
复制编译好的opencv到目录下。
5. 安装dlib:
下载:https://github.com/davisking/dlib/releases
mkdir -p ~/src
cd ~/src tar xf dlib-18.16.tar.gz
cd dlib-18.16/python_examples
mkdir build
cd build
cmake ../../tools/python
cmake --build . --config Release
sudo cp dlib.so/usr/local/lib/python2.7/dist-packages
6. 安装openface:
git clone https://github.com/cmusatyalab/openface.git
sudo python2 setup.py install
models/get-models.sh
运行demo2:
./demos/compare.py images/examples/{lennon*,clapton*}
运行demo3:
./demos/classifier.py infermodels/openface/celeb-classifier.nn4.small2.v1.pkl ./images/examples/carell.jpg