Raspberry Pi でカメラをつなぎ顔検出
【サイト内の関連ページ】
【目次】
- 必要なパッケージのインストール
sudo apt -y update sudo apt -y install cmake
- dlib をビルドしインストール
時間がかかる(20分ほど)
- 確認
バージョン番号が表示されれば OK
python3 << EOS import dlib print(dlib.__version__) EOS
-
次のコマンドで・
3つのファイルをダウンロード
この3つのファイルについての詳細説明はtrydlib.htmlの「学習済みモデルデータのダウンロードの展開(解凍)」のところ
wget http://dlib.net/files/dlib_face_recognition_resnet_model_v1.dat.bz2 wget http://dlib.net/files/mmod_human_face_detector.dat.bz2 wget http://dlib.net/files/shape_predictor_5_face_landmarks.dat.bz2 ls -la *.bz2
- 展開(解凍)し, /usr/local/dlib にコピー
bzip2 -d dlib_face_recognition_resnet_model_v1.dat.bz2 bzip2 -d mmod_human_face_detector.dat.bz2 bzip2 -d shape_predictor_5_face_landmarks.dat.bz2 sudo cp *.dat /usr/local/dlib ls -la *.dat
- 動作確認
cd /tmp/dlib cd examples/faces python3 ../../python_examples/face_recognition.py /usr/local/dlib/shape_predictor_5_face_landmarks.dat /usr/local/dlib/dlib_face_recognition_resnet_model_v1.dat .