安装openface的前三步都是按照这个博客的进行的 链接:http://www.linuxdiyf.com/linux/20268.html
第四步:安装torch按照官网进行
git clone https://github.com/torch/distro.git ~/torch --recursive cd ~/torch; bash install-deps; ./install.sh
这是已经可以启动了torch了,启动命令为th
source ~/.bashrc 启动方式1
第二种启动方式
首先安装 sudo apt-get install luajit
然后用命令luajit -ltorch启动
关闭torch用命令
: os.exit()
安装torch的包(packages),如nn和dpnn
安装opencv
这一步比较麻烦
我早torch下面建立个文件夹
root@zpj-HP-xw4550-Workstation:~/torch# mkdir -p src下载opencv2.4.11,并复制到当前路径root@zpj-HP-xw4550-Workstation:~/torch# cd src
然后unzip unzip opencv-2.4.11.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
ok,安装完成。
检验是否安装成功
进入到python
import cv2 #如果成功,就表明安装opencv成功。6、安装dlib
把下载的
dlib-18.17.tar.bz2放到了~/torch/src下面
然后,按下面的步骤进行操作python
- mkdir -p ~/src
- cd ~/src
- tar xf dlib-18.17.tar.bz2
- cd dlib-18.16/python_examples
- mkdir build
- cd build
- cmake ../../tools/python
- cmake --build . --config Release
- cp dlib.so /usr/local/lib/python2.7/dist-packages
import dlib,成功!7、Git获取openface
a.下载Openface
root@zpj-HP-xw4550-Workstation:~# git clone https://github.com/cmusatyalab/openface.git
root@zpj-HP-xw4550-Workstation:~/openface# sudo python2 setup.py install
b、获取模型
root@zpj-HP-xw4550-Workstation:~/openface# models/get-models.sh8、运行demo
运行demo1:
root@zpj-HP-xw4550-Workstation:~/openface# ./demos/compare.py images/examples/{lennon*,clapton*}
运行demo2:
root@zpj-HP-xw4550-Workstation:~/openface# ./demos/classifier.py infer models/openface/celeb-classifier.nn4.small2.v1.pkl ./images/examples/carell.jpg
运行第三个模块时,发现错误错误1:ImportError: No module named txaio sudo pip install txaio
错误2: ImportError: No module named twisted.python.failure
sudo apt-get install python-twisted
错误3:ImportError: No module named autobahn.twisted.websocket
root@zpj-HP-xw4550-Workstation:~/openface# pip install autobahn
同理如下
root@zpj-HP-xw4550-Workstation:~/openface# pip install autobahn[twisted,accelerate,compress,serialization]
root@zpj-HP-xw4550-Workstation:~/openface# sudo pip install imagehash