openface在2015年重新更新,所以再次配置openface的时候可以参考上次的步骤,这里仅作dlib部分修改,demo1 的运行指令也做出一定的修改。
原博客:
http://blog.csdn.net/shakevincent/article/details/49363413
本文主要参考了openface的网址:
https://github.com/cmusatyalab/openface
openface的官网:
http://cmusatyalab.github.io/openface/setup/
同时感谢openface的作者:bamos 在配置的时候指导,特向原作者提出感谢!
以下是原配置方案,openface的依赖项都是一样的,可以直接参考
FROM ubuntu:14.04
MAINTAINER Brandon Amos <brandon.amos.cs@gmail.com>
RUN apt-get update
RUN
apt-get install -y \
build-essential \
cmake \
curl \
gfortran \
git \
libatlas-dev \
libavcodec-dev \
libavformat-dev \
libboost-all-dev \
libgtk2.0-dev \
libjpeg-dev \
liblapack-dev \
libswscale-dev \
pkg-config \
python-dev \
python-pip \
wget \
zip
RUN
pip2 install numpy scipy pandas
RUN
pip2 install scikit-learn scikit-image
RUN
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash -e
RUN
git clone https://github.com/torch/distro.git ~/torch --recursive
RUN
cd ~/torch && ./install.sh
RUN
~/torch/install/bin/luarocks install nn
RUN
~/torch/install/bin/luarocks install dpnn
RUN
~/torch/install/bin/luarocks install image
RUN
~/torch/install/bin/luarocks install optim
RUN
cd ~ && \
mkdir -p src && \
cd src && \
curl -L https://github.com/Itseez/opencv/archive/2.4.11.zip -o ocv.zip && \
unzip ocv.zip && \
cd opencv-2.4.11 && \
mkdir release && \
cd release && \
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
.. && \
make -j8 && \
make install
RUN
cd ~ && \
mkdir -p src && \
cd src && \
curl -L \
https://github.com/davisking/dlib/releases/download/v18.16/dlib-18.16.tar.bz2 \
-o dlib.tar.bz2 && \
tar xf dlib.tar.bz2 && \
cd dlib-18.16/python_examples && \
mkdir build && \
cd build && \
cmake ../../tools/python && \
cmake --build . --config Release && \
cp dlib.so ..
但是openface在15年11月重新更新了一下,需要更新一下dlib的安装步骤。安装dlib以前的步骤都可以正常运行。
mkdir -p ~/src
cd ~/src
tar xf dlib-18.16.tar.bz2
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
For the final command, make sure the directory is in your default Python path, which can be found with sys.path in a Python interpreter.
在配置后可以检验opencv和dlib是否安装成功。只需在python的命令行中输入
import cv2
import dlib
配置完成后就应该获得训练模型了。
Run: models/get-models.sh
跟新一下数据模型,可以按照官方的doc 运行demo了。
安装过程中保证网络的流畅。