シングルフェイス解析パイプラインのデモ#

このドキュメントでは、DAG スケジューラーの実装例としてモデル・アンサンブルを示します。複数のモデルを組み合わせて、単一の予測呼び出しで複数の推論操作を実行する方法について説明します。同じデータに対して複数の予測を実行する必要がある場合、複数のモデルからの結果を結合するパイプラインを作成できます。

図

デモを実行するにはワークスペースを準備します#

この例では、次のモデルが使用されます:

age-gender-recognition-retail-0013

emotions-recognition-retail-0003

リポジトリーのクローンを作成し、single_face_analysis_pipeline ディレクトリーに移動します

git clone https://github.com/openvinotoolkit/model_server.git 
cd model_server/demos/single_face_analysis_pipeline/python

実行するだけで、上記のすべてを含むワークスペースを準備できます

make

最終ディレクトリー構造#

make が完了すると、次の内容を含む workspace ディレクトリーが準備されているはずです。

workspace/
 ├── age-gender-recognition-retail-0013
 │   └── 1       ├── age-gender-recognition-retail-0013.bin
 │       └── age-gender-recognition-retail-0013.xml
 ├── config.json 
 └── emotions-recognition-retail-0003 
      └── 1 
          ├── emotions-recognition-retail-0003.bin 
          └── emotions-recognition-retail-0003.xml

OVMS のデプロイ#

次のコマンドを使用して、単一面分析パイプラインを備えた OVMS をデプロイします:

docker run -p 9000:9000 -d -v ${PWD}/workspace:/workspace openvino/model_server --config_path /workspace/config.json --port 9000

サービスの要求#

模範的なクライアント single_face_analysis_pipeline.py を使用して、前の手順でデプロイされたパイプラインを要求できます。

pip3 install -r requirements.txt

これで、テキスト画像用のディレクトリーを作成し、クライアントを実行できるようになりました:

python single_face_analysis_pipeline.py --image_path ../../common/static/images/faces/face1.jpg --grpc_port 9000 
Age results: [[[21.099792]]] 
Gender results: Female: 0.9483401 ; Male: 0.051659837 
Emotion results: Natural: 0.02335789 ; Happy: 0.9449672 ; Sad: 0.001236845 ; Surprise: 0.028111042 ; Angry: 0.0023269346

次のステップ#

同じ画像の複数の顔を抽出して分析するさらに高度な使用例については、multi_faces_analysis_pipeline デモを参照してください。