LoginSignup
12

More than 3 years have passed since last update.

OpenVinoで顔関係のライブラリがだいぶそろっている

Last updated at Posted at 2019-09-09

この記事を書いた後に、有用な記事を見つけました。
有効な参考情報先 OpenVINO の 顔検出・分析デモを Pythonでやってみる

それを読めば、この記事は不要です。


先にOpenCV だけで顔検出から顔照合まで完結していることを書いた。

OpenVinoでも顔関係のライブラリが充実していることに気づいたので、メモを示す。
OpenVinoの場合にはIntelのデバイスを使える環境ならば、同じ学習済みのモデルが使えるので、実行環境の移植性が格段に向上する。

Intelのデバイスが使える環境というのは、以下の環境です。

  • Intel のCPUが使える環境(Linux, Windows)
  • IntelのCPUに付随するGPUの使える環境
  • Intelのmovidius neural compute stick 2 を使える環境
    • Raspberry Pi + movidius neural compute stick 2
  • IntelのFPGA(旧AleraのFPGA)が使える環境


# Intel® Movidius™ Neural Compute stick を使って顔検出だけをする例
# Run the face demo, face detection only, on the Intel® Movidius™ Neural Compute stick

$ ./interactive_face_detection_demo -i cam -m $models/Retail/object_detection/face/sqnet1.0modif-ssd/0004/dldt/FP16/face-detection-retail-0004.xml -d MYRIAD

# 顔検出に加えて年齢と性別を加える. CPUで動作。
# Now we add (to the face detection) also an age and gender detection, running on the CPU

$ ./interactive_face_detection_demo -i cam -m $models/Retail/object_detection/face/sqnet1.0modif-ssd/0004/dldt/FP16/face-detection-retail-0004.xml -d MYRIAD -m_ag $models/Retail/object_attributes/age_gender/dldt/FP32/age-gender-recognition-retail-0013.xml -d_ag CPU 

# 頭部向き推定を加える GPUで動作.
# Now let’s add head position detection running on GPU.

$ ./interactive_face_detection_demo -i cam -m $models/Retail/object_detection/face/sqnet1.0modif-ssd/0004/dldt/FP16/face-detection-retail-0004.xml -d MYRIAD -m_ag $models/Retail/object_attributes/age_gender/dldt/FP32/age-gender-recognition-retail-0013.xml -d_ag CPU -d_ag CPU -m_hp $models/Transportation/object_attributes/headpose/vanilla_cnn/dldt/FP16/head-pose-estimation-adas-0001.xml -d_hp GPU

# 表情検出を加える CPUで動作
# Now we’ll add an emotion detector, running on the CPU

$ ./interactive_face_detection_demo -i cam -m $models/Retail/object_detection/face/sqnet1.0modif-ssd/0004/dldt/FP16/face-detection-retail-0004.xml -d MYRIAD -m_ag $models/Retail/object_attributes/age_gender/dldt/FP32/age-gender-recognition-retail-0013.xml -d_ag CPU -d_ag CPU -m_hp $models/Transportation/object_attributes/headpose/vanilla_cnn/dldt/FP16/head-pose-estimation-adas-0001.xml -d_hp GPU -m_em $models/Retail/object_attributes/emotions_recognition/0003/dldt/INT8/emotions-recognition-retail-0003.xml -d_em CPU

#顔特徴点の検出を加える。CPUで動作
# Now let's add facial landmarks detector, running on the CPU

$ ./interactive_face_detection_demo -i cam -m $models/Retail/object_detection/face/sqnet1.0modif-ssd/0004/dldt/FP16/face-detection-retail-0004.xml -d MYRIAD -m_ag $models/Retail/object_attributes/age_gender/dldt/FP32/age-gender-recognition-retail-0013.xml -d_ag CPU -d_ag CPU -m_hp $models/Transportation/object_attributes/headpose/vanilla_cnn/dldt/FP16/head-pose-estimation-adas-0001.xml -d_hp GPU -m_em $models/Retail/object_attributes/emotions_recognition/0003/dldt/INT8/emotions-recognition-retail-0003.xml -d_em CPU -m_lm  $models/Transportation/object_attributes/facial_landmarks/custom-35-facial-landmarks/dldt/FP32/facial-landmarks-35-adas-0002.xml -d_lm CPU



OpenVinoでは以下の pre-trained model が使用できます。

Overview of OpenVINO™ Toolkit Pre-Trained Models

自分で何かモデルを作ろうとする際には、ぜひ既存のモデルを上手に活用してください。

また、OpenVinoはcaffeやtensorflowの学習済みモデルをOpenVino用に変換するツールを持っています。

顔照合関係の学習済みモデル


参考URL
Install Intel® Distribution of OpenVINO™ toolkit for Linux*

以下の記事は実際にPythonのコードを示している記事です。
OpenVINO の 顔検出・分析デモを Pythonでやってみる

OpenVINO で Face re-identification (顔再識別)

 V-net AAEONが提供する「AI CORE Xスターターキット」は、IntelのVPU(Vision Processing Unit)「Myriad X」と、高性能なコンピュータビジョンやディープラーニングを開発できる「OpenVINOツールキット」 産業グレードでファンレスのお手軽AI開発キット、工場などの現場で即運用可能

購入先の例
https://shop.tsukumo.co.jp/goods/4589420940463/

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
12