複数 ONNX モデルの融合トリックと OpenVINO™ ツールキット API 2.0 を使用した Multi-Batch 360° 6D HeadPose 推定

8.1K Views

September 01, 22

スライド概要

・様々なONNX改造テクニックのご紹介
・複数ONNXモデルの融合によるモデル対応タスクの拡張
・OpenVINO API 2.0 による Multi-Batch推論対応のOpenVINO IR変換

profile-image

Hobby Programmer. Caffe, Tensorflow, NCS, RaspberryPi, Latte Panda, ROS, DL, TPU, OpenVINO. Intel Software Innovator. The remarks are my personal opinion.

シェア

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

複数 ONNX モデルの融合トリックと OpenVINO™ ツールキット API 2.0 を 使用した Multi-Batch 360°6D HeadPose 推定 株式会社サイバーエージェント AI Lab リサーチエンジニア 兵頭 亮哉

2.

兵頭 亮哉 (Katsuya Hyodo / a.k.a PINTO) • 株式会社サイバーエージェント AI Lab HCIチーム リサーチエンジニア • 接客対話エージェントの研究・開発 • 大阪大学大学院基礎工学研究科 招聘研究員の方々の開発面をサポート Twitter GitHub Discord • 対象領域は HCI/HRI/インタラクション/対話システム/機械学習/画 像処理/自然言語処理 @PINTO03091 @PINTO0309 @PINTO @PINTO @PINTO0309 2

3.

アジェンダ

4.

1. SOTAモデルの激しい入れ替わりとパラメータの増加 2. モデル軽量化の既存手法(枝刈り・蒸留・量子化) 3. 複数タスクの融合 4. ONNXの加工パターン 5. OpenVINO™ API 2.0 6. FaceDetection と HeadDetection 7. HeadPose推定 8. 360°3D HeadPose推定 4

5.

SOTAモデルの激しい入れ替わり とパラメータの増加

6.

引用:https://github.com/WongKinYiu/yolov7 引用:https://paperswithcode.com/sota/semantic-segmentation-on-cityscapes 6

7.

モデル軽量化の既存手法 (枝刈り・蒸留・量子化)

8.

1. 枝刈り(Pruning) • 推論全体の影響が小さいノードを削除して軽量化・高速化 2. 蒸留(Distillation) • 大きなモデルで学習した知識を小さなモデルへ転移して軽 量化・高速化 3. 量子化(Quantize) • 重みを Float32 より小さい演算精度へ落とすことで軽量 化・高速化 8

9.

複数タスクの融合

10.

DeHaize DeBlur Prediction Object Detection DeRain Artistic Segmentation Pose Prediction DeSnow Shadow Removal Depth Prediction Super Resolution DeNoise Reflection Removal Action Recognition Anomaly Detection 10

11.

DeHaize DeBlur Prediction Object Detection DeRain Artistic Segmentation Pose Prediction DeSnow Shadow Removal Depth Prediction Super Resolution DeNoise Reflection Removal Action Recognition Anomaly Detection 11

12.

DeHaize DeBlur Prediction Object Detection DeRain Artistic Segmentation Pose Prediction DeSnow Shadow Removal Depth Prediction Super Resolution DeNoise Reflection Removal Action Recognition Anomaly Detection 12

13.

ONNXの加工パターン

14.

https://github.com/PINTO0309/simple-onnx-processing-tools 14

15.

OpenVINO™ API 2.0

16.

CPU推論でダイナミックシェイプに対応 • With Dynamic Input Shapes capabilities on CPU, OpenVINO will be able to adapt to multiple input dimensions in a single model providing more complete NLP support. Dynamic Shapes support on additional XPUs expected in a future dot release. • Working with dynamic shapes. The feature is quite useful for best performance for Neural Language Processing (NLP) models, superresolution models, and other which accepts dynamic input shapes. Note: Models compiled with dynamic shapes may show reduced performance and consume more memory than models configured with a static shape on the same input tensor size. Setting upper bounds to reshape the model for dynamic shapes or splitting the input into several parts is recommended. 引用:https://github.com/openvinotoolkit/openvino/releases/tag/2022.1.0 16

17.

FaceDetection と HeadDetection

18.

Face Detection Head Detection RetinaFaceなど 頭部を学習させた物体検出モデル全般 • 検出範囲が狭い • 顔のキーポイント取得性能が高い • 顔のキーポイントを目安に検出している ようで後頭部は検出できない • 検出範囲が広い • 後頭部も検出できる • 「顔」としての認識性能は低め 18

19.

HeadPose推定

20.

正面 背面 正面 Yaw Roll Pitch 背面 • 頭部全体の特徴を使用して向きを推定 • Face Detectionで切り出した顔では特徴 をとる範囲が狭すぎる • 頭部全体を使用して推定対象とする必要 がある 20

21.

6DRepNet Full-Range SOTA ※ SOTAだけど後ろ向きは検出できない @misc{hempel20226d, title={6D Rotation Representation For Unconstrained Head Pose Estimation}, author={Thorsten Hempel and Ahmed A. Abdelrahman and Ayoub Al-Hamadi}, year={2022}, eprint={2202.12555}, archivePrefix={arXiv}, primaryClass={cs.CV} } WHENet Full-Range ※ SOTAではないけど後ろ向きが検出できる @misc{https://doi.org/10.48550/arxiv.2005.10353, doi = {10.48550/ARXIV.2005.10353}, url = {https://arxiv.org/abs/2005.10353}, author = {Zhou, Yijun and Gregson, James}, title = {WHENet: Real-time Fine-Grained Estimation for Wide Range Head Pose}, publisher = {arXiv}, year = {2020}, } 21

22.

360°3D HeadPose推定

23.

6DRepNet WHENet DMHead 23

24.

https://github.com/PINTO0309/DMHead 24

25.

• 前方 -75°~+75°の範囲のみ活性化するONNX部品を作る • 後方 -76°~-180°と+76°~+180°の範囲のみ活性化するONNX部品を作る • 2つの部品を HeadPose 推定モデル本体に融合 Front Side Rear Side 25

26.

• モデルの入力はひとつ • モデルの最終出力はひとつ • バッチサイズは N(任意) Front Side Rear Side 26

27.

mo ¥ --framework onnx ¥ --input_model dmhead_mask_Nx3x224x224.onnx ¥ --data_type FP32 ¥ --output_dir dmhead_mask_Nx3x224x224/openvino/FP32 ¥ --model_name dmhead_mask_Nx3x224x224 27

29.

正面 背面 29

30.

ご清聴ありがとうございました

31.

Appendix

32.

https://github.com/PINTO0309/DMHead https://github.com/thohemp/6DRepNet https://github.com/Ascend-Research/HeadPoseEstimationWHENet https://github.com/PINTO0309/simple-onnx-processing-tools https://docs.openvino.ai/latest/get_started.html 32