您的位置:首页 > 运维架构

Openface在Liunx下配置成功运行:

2015-10-23 16:47 495 查看
本文主要参考了openface的网址:https://github.com/cmusatyalab/openface

同时感谢openface的作者:bamos在配置的时候知道,特向原作者提出感谢!

1:安装依赖项:

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 ..

安装步骤安装应该没有不会出错。

首先需要获得
models/openface/celeb-classifier.nn4.v1.pkl
.。

Run:
models/get-models.sh

此时openface平台已经配置成功可以运行demo了

2:运行demo2:

按照官网提示直接运行就行。

贴上我运行的结果

Comparing images/examples/lennon-1.jpg with images/examples/lennon-2.jpg.

+ Squared l2 distance between representations: 0.309903459228

Comparing images/examples/lennon-1.jpg with images/examples/clapton-1.jpg.

+ Squared l2 distance between representations: 1.24080096219

Comparing images/examples/lennon-1.jpg with images/examples/clapton-2.jpg.

+ Squared l2 distance between representations: 1.05589412216

Comparing images/examples/lennon-2.jpg with images/examples/clapton-1.jpg.

+ Squared l2 distance between representations: 1.38612403652

Comparing images/examples/lennon-2.jpg with images/examples/clapton-2.jpg.

+ Squared l2 distance between representations: 1.07297598188

Comparing images/examples/clapton-1.jpg with images/examples/clapton-2.jpg.

+ Squared l2 distance between representations: 0.258562088431

3:运行demo3:

./demos/classifier.py infer ./models/openface/csleb-classifier.nn4.v1.pkl <images>

只需把image的路径修改为自己图片的路径即可运行。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: