安装Openface,实现人脸比对
安裝Python基礎(chǔ)類庫
pip install numpy scipy pandas
pip install scikit-learn scikit-image
顯示已安裝類庫執(zhí)行命令pip list
安裝OpenCV 2.4.11
安裝文檔
http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html
下載源代碼
https://github.com/opencv/opencv/archive/2.4.11.zip
unzip opencv-2.4.11.zip
cd opencv-2.4.11
安裝第三方依賴
sudo apt-get install build-essential sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev mkdir releasecd release
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DCUDA_GENERATION=Kelper ..
禁用CUDA,-DWITH_CUDA=NO
make -j8
sudo make install
驗(yàn)證opencv
安裝dlib
下載https://github.com/davisking/dlib/releases/download/v18.16/dlib-18.16.tar.bz2
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
驗(yàn)證dlib
安裝Torch (luajit方式)
git clone https://github.com/torch/distro.git --recursive
mv distro torch
cd torch
bash install-deps
./install.sh
另外一種安裝方式,使用lua代替luajit
git clone https://github.com/torch/distro.git --recursive
mv distro torch
cd torch
./clean.sh
TORCH_LUA_VERSION=LUA52 ./install.sh
運(yùn)行torch
source ~/.bashrc
th
退出torch
os.exit()
安裝torch第三方依賴,通過lua的包管理工具安裝
luarocks install dpnn nn optim optnet csvigo cutorch cunn fblualib torchx tds
顯示已安裝包luarocks list
安裝OpenFace
git clone https://github.com/cmusatyalab/openface.git
sudo python setup.py install
models/get-models.sh #下載訓(xùn)練好的模型數(shù)據(jù)
測(cè)試
從網(wǎng)上下載5張照片
f1.jpg
f2.jpg
f3.jpg
l1.jpg
l2.jpg
./demo/compare.py images/examples/f1.jpg images/examples/f2.jpg
./demo/compare.py images/examples/f1.jpg images/examples/f3.jpg
/demo/compare.py images/examples/f1.jpg images/examples/l1.jpg
./demo/compare.py images/examples/f1.jpg images/examples/l2.jpg
返回結(jié)果數(shù)值越小,代表兩張人臉越接近。
總結(jié)
以上是生活随笔為你收集整理的安装Openface,实现人脸比对的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ARM机器学习新平台Trillium
- 下一篇: kubernetes1.8.4 安装指南