LoginSignup
25
27

More than 5 years have passed since last update.

dlib の顔認識を試す

Last updated at Posted at 2015-12-17

概要

dlib と CLM-framework について解説している記事 "Facial Landmark Detection" を参考にして dlib をコンパイルし、デモの webcam_face_pose_ex を動かします。

自分の環境で上手く行かなかった部分についてまとめます。

環境

OSX El Capitan (10.11.2)

準備

X11

XQuartz から XQuartz-2.7.8.dmg をインストールします。

dlib のコンパイル時に fatal error: 'X11/Xlib.h' file not found のエラーが出たので、シンボリックリンクを貼ります。

ln -s /opt/X11/include/X11 /usr/local/include/X11
http://stackoverflow.com/a/12089021/1567777

dlib のコンパイル

git clone https://github.com/davisking/dlib.git
cd dlib/examples
mkdir build
cd build
cmake .. 
cmake --build . --config Release

10分くらいかかったので、CMakeLists.txt から必要ない add_example を消すと良いと思います。

CMakeLists.txt
add_example(3d_point_cloud_ex)
...
add_example(xml_parser_ex)

ここまで消す

モデルファイルの用意

http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 をダウンロードして examples/build/shape_predictor_68_face_landmarks.dat に解凍します。

実行

./webcam_face_pose_ex

結果

スクリーンショット 2015-12-17 18.06.54.png

めっちゃスゴい。

25
27
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
25
27