Ubuntu下OpenFace编译过程

首先要下载OpenFace,可在下方链接下载。

https://download.csdn.net/download/qq_29840153/11224681

安装基本依赖项

echo "Installing Essential dependencies..."
sudo rm /var/lib/apt/lists/lock
sudo apt-get -y update
sudo apt-get -y install build-essential
sudo apt-get -y install cmake
sudo apt-get -y install libopenblas-dev liblapack-dev
sudo apt-get -y install git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get -y install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev

安装OpenCV3.3

官网下载实在太慢,于是我将下载好的四个版本贴了出来,可自行下载。

https://download.csdn.net/download/qq_29840153/11224643

cd opencv-3.3.0
mkdir -p build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_CUDA=OFF -D BUILD_SHARED_LIBS=OFF ..
make -j4
sudo make install

安装dlib

wget http://dlib.net/files/dlib-19.13.tar.bz2;
tar xf dlib-19.13.tar.bz2;
cd dlib-19.13;
mkdir -p build;
cd build;
cmake ..;
cmake --build . --config Release;
sudo make install;
sudo ldconfig;

安装Boost

sudo apt-get install libboost-all-dev

安装OpenFace

mkdir -p build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE ..
make

此时会报错patch_experts中没有数据包。

OpenFace运行时需要的数据包较大,因此需要另外下载,下载后解压放入OpenFace/build/bin/model/patch_experts中。

https://download.csdn.net/download/qq_29840153/11225197

然后再执行

make

测试

图片

./bin/FaceLandmarkImg -f "../samples/sample3.jpg" -verbose

单脸

./bin/FaceLandmarkVid -f "../samples/default.wmv" -verbose

多脸
./bin/FaceLandmarkVidMulti -f "../samples/multi_face.avi" -verbose

camera

 ./bin/FaceLandmarkVid -f /dev/video0*

 

Ubuntu下OpenFace编译过程_第1张图片

 

你可能感兴趣的:(计算机视觉,计算机视觉)