私的AI研究会 > OpenModelZoo2
OpenVINO™ Toolkit に付属するデモソフトを動かしてアプリケーションで推論エンジンを使用する方法を調べる。その2
このデモでは、ビデオまたは画像での人間のポーズ推定のためのトップダウン パイプラインを紹介する。タスクは、フレーム上のすべての人のbboxを予測し、検出されたすべての人のポーズを予測する。ポーズには、耳、目、鼻、肩、肘、手首、腰、膝、足首の最大17のキーポイントが含まれる場合がある。(機械翻訳)
入力画像のパス <path_to_video>: ~/Videos モデルのパス <path_to_model>: ~/model/public/FP32 or ~/model/public/FP16 学習済モデル mobilenet-ssd single-human-pose-estimation-0001
$ python3 single_human_pose_estimation_demo.py -h usage: single_human_pose_estimation_demo.py [-h] -m_od MODEL_OD -m_hpe MODEL_HPE -i INPUT [--loop] [-o OUTPUT] [-limit OUTPUT_LIMIT] [-d DEVICE] [--person_label PERSON_LABEL] [--no_show] [-u UTILIZATION_MONITORS] optional arguments: -h, --help show this help message and exit -m_od MODEL_OD, --model_od MODEL_OD Required. Path to model of object detector in .xml format. -m_hpe MODEL_HPE, --model_hpe MODEL_HPE Required. Path to model of human pose estimator in .xml format. -i INPUT, --input INPUT Required. An input to process. The input must be a single image, a folder of images, video file or camera id. --loop Optional. Enable reading the input in a loop. -o OUTPUT, --output OUTPUT Optional. Name of output to save. -limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT Optional. Number of frames to store in output. If 0 is set, all frames are stored. -d DEVICE, --device DEVICE Optional. Specify the target to infer on CPU or GPU. --person_label PERSON_LABEL Optional. Label of class person for detector. --no_show Optional. Do not display output. -u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS Optional. List of monitors to show initially.
$ python3 single_human_pose_estimation_demo.py --model_od ~/model/public/FP32/mobilenet-ssd.xml --model_hpe ~/model/public/FP32/single-human-pose-estimation-0001.xml --input ~/Videos/person_m.mp4
項目 | Core™ i5-10210 | Core™ i7-6700 | Celeron® J4005 | Celeron® J4005 + NCS2 | Core™ i7-2620M |
summary (fps) | 0.9 | 0.7 | 0.1 | 0.5 | 0.2 |
estimation (fps) | 5.6 | 2.4 | 0.3 | 1.6 | 0.5 |
detection (fps) | 109.9 | 69.1 | 9.1 | 22.2 | 14.3 |
このデモでは、ニューラル ネットワークのシーケンスを使用して、顔認識に適用されるオブジェクト検出タスクを紹介する。非同期 API は、推論が完了するのを待つのではなく、アクセラレータがビジー状態の間、アプリケーションがホスト上で動作し続けることができるので、アプリケーションの全体的なフレームレートを向上させることができる。このデモでは、年齢/性別認識、頭部ポーズ推定、感情認識、顔面ランドマーク検出、およびスプーフィング防止分類ネットワークに対する 5 つの並列推論要求を同時に実行する。
(機械翻訳)
facial-landmarks-35-adas-0002
最初のモデルの結果の上に実行され、推定された顔のランドマークの規範座標を報告する。
入力画像のパス <path_to_video>: ~/Videos モデルのパス <path_to_model>: ~/model/intel/FP32 or ~/model/intel/FP16 学習済モデル age-gender-recognition-retail-0013 head-pose-estimation-adas-0001 emotions-recognition-retail-0003 facial-landmarks-35-adas-0002 anti-spoof-mn3~
$ ./interactive_face_detection_demo -h InferenceEngine: API version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 interactive_face_detection_demo [OPTION] Options: -h Print a usage message -i Required. An input to process. The input must be a single image, a folder of images, video file or camera id. -loop Optional. Enable reading the input in a loop. -o "<path>" Optional. Name of output to save. -limit "<num>" Optional. Number of frames to store in output. If 0 is set, all frames are stored. -m "<path>" Required. Path to an .xml file with a trained Face Detection model. -m_ag "<path>" Optional. Path to an .xml file with a trained Age/Gender Recognition model. -m_hp "<path>" Optional. Path to an .xml file with a trained Head Pose Estimation model. -m_em "<path>" Optional. Path to an .xml file with a trained Emotions Recognition model. -m_lm "<path>" Optional. Path to an .xml file with a trained Facial Landmarks Estimation model. -m_am "<path>" Optional. Path to an .xml file with a trained Antispoofing Classification model. -l "<absolute_path>" Required for CPU custom layers. Absolute path to a shared library with the kernels implementation. Or -c "<absolute_path>" Required for GPU custom kernels. Absolute path to an .xml file with the kernels description. -d "<device>" Optional. Target device for Face Detection network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -d_ag "<device>" Optional. Target device for Age/Gender Recognition network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -d_hp "<device>" Optional. Target device for Head Pose Estimation network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -d_em "<device>" Optional. Target device for Emotions Recognition network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -d_lm "<device>" Optional. Target device for Facial Landmarks Estimation network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -d_am "<device>" Optional. Target device for Antispoofing Classification network (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. -n_ag "<num>" Optional. Number of maximum simultaneously processed faces for Age/Gender Recognition network (by default, it is 16) -n_hp "<num>" Optional. Number of maximum simultaneously processed faces for Head Pose Estimation network (by default, it is 16) -n_em "<num>" Optional. Number of maximum simultaneously processed faces for Emotions Recognition network (by default, it is 16) -n_lm "<num>" Optional. Number of maximum simultaneously processed faces for Facial Landmarks Estimation network (by default, it is 16) -n_am "<num>" Optional. Number of maximum simultaneously processed faces for Antispoofing Classification network (by default, it is 16) -dyn_ag Optional. Enable dynamic batch size for Age/Gender Recognition network -dyn_hp Optional. Enable dynamic batch size for Head Pose Estimation network -dyn_em Optional. Enable dynamic batch size for Emotions Recognition network -dyn_lm Optional. Enable dynamic batch size for Facial Landmarks Estimation network -dyn_am Optional. Enable dynamic batch size for Antispoofing Classification network -async Optional. Enable asynchronous mode -no_show Optional. Do not show processed video. -pc Optional. Enable per-layer performance report -r Optional. Output inference results as raw values -t Optional. Probability threshold for detections -bb_enlarge_coef Optional. Coefficient to enlarge/reduce the size of the bounding box around the detected face -dx_coef Optional. Coefficient to shift the bounding box around the detected face along the Ox axis -dy_coef Optional. Coefficient to shift the bounding box around the detected face along the Oy axis -fps Optional. Maximum FPS for playing video -no_smooth Optional. Do not smooth person attributes -no_show_emotion_bar Optional. Do not show emotion bar -u Optional. List of monitors to show initially. [E:] [BSL] found 0 ioexpander device Available target devices: CPU GNA MYRIAD
$ ./interactive_face_detection_demo -i ~/Videos/emotion2_m.mp4 -m ~/model/intel/FP32/face-detection-adas-0001.xml -m_ag ~/model/intel/FP32/age-gender-recognition-retail-0013.xml -m_hp ~/model/intel/FP32/head-pose-estimation-adas-0001.xml -m_em ~/model/intel/FP32/emotions-recognition-retail-0003.xml -m_lm ~/model/intel/FP32/facial-landmarks-35-adas-0002.xml -m_am ~/model/public/FP32/anti-spoof-mn3.xml InferenceEngine: API version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 [ INFO ] Parsing input parameters [ INFO ] Loading device CPU [ INFO ] CPU MKLDNNPlugin version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 [ INFO ] Loading network files for Face Detection [ INFO ] Batch size is set to 1 [ INFO ] Checking Face Detection network inputs [ INFO ] Checking Face Detection network outputs [ INFO ] Loading Face Detection model to the CPU device [ INFO ] Loading network files for Age/Gender Recognition network [ INFO ] Batch size is set to 16 for Age/Gender Recognition network [ INFO ] Checking Age/Gender Recognition network inputs [ INFO ] Checking Age/Gender Recognition network outputs [ INFO ] Loading Age/Gender Recognition model to the CPU plugin [ INFO ] Loading network files for Head Pose Estimation network [ INFO ] Batch size is set to 16 for Head Pose Estimation network [ INFO ] Checking Head Pose Estimation network inputs [ INFO ] Checking Head Pose Estimation network outputs [ INFO ] Loading Head Pose Estimation model to the CPU plugin [ INFO ] Loading network files for Emotions Recognition [ INFO ] Batch size is set to 16 for Emotions Recognition [ INFO ] Checking Emotions Recognition network inputs [ INFO ] Checking Emotions Recognition network outputs [ INFO ] Loading Emotions Recognition model to the CPU plugin [ INFO ] Loading network files for Facial Landmarks Estimation [ INFO ] Batch size is set to 16 for Facial Landmarks Estimation network [ INFO ] Checking Facial Landmarks Estimation network inputs [ INFO ] Checking Facial Landmarks Estimation network outputs [ INFO ] Loading Facial Landmarks Estimation model to the CPU plugin [ INFO ] Loading network files for Antispoofing Classifier network [ INFO ] Batch size is set to 16 for Antispoofing Classifier network [ INFO ] Checking Antispoofing Classifier network inputs [ INFO ] Checking Antispoofing Classifier network outputs [ INFO ] Loading Antispoofing Classifier model to the CPU plugin To close the application, press 'CTRL+C' here or switch to the output window and press Q or Esc [ INFO ] Number of processed frames: 83 [ INFO ] Total image throughput: 17.2763 fps [ INFO ] Execution successful
項目 | Core™ i5-10210 | Core™ i7-6700 | Celeron® J4005 | Celeron® J4005 + NCS2 | Core™ i7-2620M |
throughput (fps) | 19.3 | 9.16 | 0.45 | 0.6 | 1.9 |
このデモでは、視線推定モデルの作業を紹介する。(機械翻訳)
入力画像のパス <path_to_video>: ~/Videos モデルのパス <path_to_model>: ~/model/intel/FP32 or ~/model/intel/FP16 学習済モデル gaze-estimation-adas-0002 face-detection-adas-0001 face-detection-retail-0004 head-pose-estimation-adas-0001 facial-landmarks-35-adas-0002 open-closed-eye-0001
$ ./gaze_estimation_demo -h InferenceEngine: API version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 gaze_estimation_demo [OPTION] Options: -h Print a usage message. -i Required. An input to process. The input must be a single image, a folder of images, video file or camera id. -loop Optional. Enable reading the input in a loop. -o "<path>" Optional. Name of output to save. -limit "<num>" Optional. Number of frames to store in output. If 0 is set, all frames are stored. -res "<WxH>" Optional. Set camera resolution in format WxH. -m "<path>" Required. Path to an .xml file with a trained Gaze Estimation model. -m_fd "<path>" Required. Path to an .xml file with a trained Face Detection model. -m_hp "<path>" Required. Path to an .xml file with a trained Head Pose Estimation model. -m_lm "<path>" Required. Path to an .xml file with a trained Facial Landmarks Estimation model. -m_es "<path>" Required. Path to an .xml file with a trained Open/Closed Eye Estimation model. -d "<device>" Optional. Target device for Gaze Estimation network (the list of available devices is shown below). Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. Default value is "CPU". -d_fd "<device>" Optional. Target device for Face Detection network (the list of available devices is shown below). Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. Default value is "CPU". -d_hp "<device>" Optional. Target device for Head Pose Estimation network (the list of available devices is shown below). Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. Default value is "CPU". -d_lm "<device>" Optional. Target device for Facial Landmarks Estimation network (the list of available devices is shown below). Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. Default value is "CPU". -d_es "<device>" Optional. Target device for Open/Closed Eye network (the list of available devices is shown below). Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The demo will look for a suitable plugin for a specified device. Default value is "CPU". -fd_reshape Optional. Reshape Face Detector network so that its input resolution has the same aspect ratio as the input frame. -no_show Optional. Do not show processed video. -pc Optional. Enable per-layer performance report. -r Optional. Output inference results as raw values. -t Optional. Probability threshold for Face Detector. The default value is 0.5. -u Optional. List of monitors to show initially. [E:] [BSL] found 0 ioexpander device Available target devices: CPU GNA MYRIAD
ランタイム コントロール キー
デモでは、実行時に表示される情報を制御できる。次のキーがサポートされている。
$ ./gaze_estimation_demo -i ~/Videos/emotion2_m.mp4 -m ~/model/intel/FP32/gaze-estimation-adas-0002.xml -m_fd ~/model/intel/FP32/face-detection-retail-0004.xml -m_hp ~/model/intel/FP32/head-pose-estimation-adas-0001.xml -m_lm ~/model/intel/FP32/facial-landmarks-35-adas-0002.xml -m_es ~/model/public/FP32/open-closed-eye-0001.xml InferenceEngine: API version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 [ INFO ] Parsing input parameters [ INFO ] Loading device CPU [ INFO ] CPU MKLDNNPlugin version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 [ INFO ] Execution successful
項目 | Core™ i5-10210 | Core™ i7-6700 | Celeron® J4005 | Celeron® J4005 + NCS2 | Core™ i7-2620M |
Overeli (fps) | 110 | 63 | 5 | 5 | 14 |
Interface (fps) | 202 | 106 | 5 | 7 | 16 |
このデモでは、車両およびライセンス プレート検出ネットワークと、検出結果の上に適用される車両属性認識およびライセンス プレート認識ネットワークを紹介する。(機械翻訳)
起動時に、アプリケーションはコマンド ライン パラメータを読み取り、指定されたネットワークを読み込む。車両とライセンスプレート検出ネットワークが必要であり、他の2つはオプション。
アプリケーション パイプラインのコア コンポーネントは、クラスの受信インスタンスを実行する Worker クラス。処理するデータと、データの処理方法を記述する抽象クラス。例えば、フレームを読み取ったり、検出結果を取得したりすることができるインスタンスのプールがある。これらは実行されるのを待っている。プールから を実行すると、プールに別のを作成または送信できる。各オブジェクトは、インスタンスへのスマート ポインターを格納する。シーケンスが完了し、インスタンスが必要な場合は、破棄される。これにより、新しいシーケンスが作成される。このデモのパイプラインは、次のシーケンスを実行する。
入力画像のパス <path_to_video>: ~/Videos モデルのパス <path_to_model>: ~/model/intel/FP32 or ~/model/intel/FP16 学習済モデル vehicle-license-plate-detection-barrier-0106 vehicle-license-plate-detection-barrier-0123 vehicle-attributes-recognition-barrier-0039 vehicle-attributes-recognition-barrier-0042 license-plate-recognition-barrier-0001 license-plate-recognition-barrier-0007
$ ./security_barrier_camera_demo -h [ INFO ] InferenceEngine: API version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 interactive_vehicle_detection [OPTION] Options: -h Print a usage message. -i "<path1>" "<path2>" Required for video or image files input. Path to video or image files. -m "<path>" Required. Path to the Vehicle and License Plate Detection model .xml file. -m_va "<path>" Optional. Path to the Vehicle Attributes model .xml file. -m_lpr "<path>" Optional. Path to the License Plate Recognition model .xml file. -l "<absolute_path>" Required for CPU custom layers. Absolute path to a shared library with the kernels implementation. Or -c "<absolute_path>" Required for GPU custom kernels. Absolute path to an .xml file with the kernels description. -d "<device>" Optional. Specify the target device for Vehicle Detection (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The application looks for a suitable plugin for the specified device. -d_va "<device>" Optional. Specify the target device for Vehicle Attributes (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The application looks for a suitable plugin for the specified device. -d_lpr "<device>" Optional. Specify the target device for License Plate Recognition (the list of available devices is shown below). Default value is CPU. Use "-d HETERO:<comma-separated_devices_list>" format to specify HETERO plugin. The application looks for a suitable plugin for the specified device. -pc Optional. Enables per-layer performance statistics. -r Optional. Output inference results as raw values. -t Optional. Probability threshold for vehicle and license plate detections. -no_show Optional. Do not show processed video. -auto_resize Optional. Enable resizable input with support of ROI crop and auto resize. -nireq Optional. Number of infer requests. 0 sets the number of infer requests equal to the number of inputs. -nc Required for web camera input. Maximum number of processed camera inputs (web cameras). -fpga_device_ids Optional. Specify FPGA device IDs (0,1,n). -loop_video Optional. Enable playing video on a loop. -n_iqs Optional. Number of allocated frames. It is a multiplier of the number of inputs. -ni Optional. Specify the number of channels generated from provided inputs (with -i and -nc keys). For example, if only one camera is provided, but -ni is set to 2, the demo will process frames as if they are captured from two cameras. 0 sets the number of input channels equal to the number of provided inputs. -fps Optional. Set the playback speed not faster than the specified FPS. 0 removes the upper bound. -n_wt Optional. Set the number of threads including the main thread a Worker class will use. -display_resolution Optional. Specify the maximum output window resolution. -tag Required for HDDL plugin only. If not set, the performance on Intel(R) Movidius(TM) X VPUs will not be optimal. Running each network on a set of Intel(R) Movidius(TM) X VPUs with a specific tag. You must specify the number of VPUs for each network in the hddl_service.config file. Refer to the corresponding README file for more information. -nstreams "<integer>" Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode (for HETERO and MULTI device cases use format <device1>:<nstreams1>,<device2>:<nstreams2> or just <nstreams>) -nthreads "<integer>" Optional. Number of threads to use for inference on the CPU (including HETERO and MULTI cases). -u Optional. List of monitors to show initially. [E:] [BSL] found 0 ioexpander device Available target devices: CPU GNA MYRIAD
$ ./security_barrier_camera_demo -i ~/Videos/car-detection.mp4 -m ~/model/intel/FP32/vehicle-license-plate-detection-barrier-0106.xml -m_va ~/model/intel/FP32/vehicle-attributes-recognition-barrier-0039.xml -m_lpr ~/model/intel/FP32/license-plate-recognition-barrier-0001.xml [ INFO ] InferenceEngine: API version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 [ INFO ] Files were added: 1 [ INFO ] /home/mizutu/Videos/car-detection.mp4 [ INFO ] Loading device CPU [ INFO ] CPU MKLDNNPlugin version ......... 2.1 Build ........... 2021.3.0-2787-60059f2c755-releases/2021/3 [ INFO ] Loading detection model to the CPU plugin [ INFO ] Loading Vehicle Attribs model to the CPU plugin [ INFO ] Loading Licence Plate Recognition (LPR) model to the CPU plugin [ INFO ] Number of InferRequests: 1 (detection), 3 (classification), 3 (recognition) [ INFO ] 4 streams for CPU [ INFO ] Display resolution: 1920x1080 [ INFO ] Number of allocated frames: 3 [ INFO ] Resizable input with support of ROI crop and auto resize is disabled 192.1FPS for (375 / 1) frames Detection InferRequests usage: 100.0% [ INFO ] Execution successful
項目 | Core™ i5-10210 | Core™ i7-6700 | Celeron® J4005 | Celeron® J4005 + NCS2 | Core™ i7-2620M |
fps | 164.5 | 106 | 11.7 | 24.7 | 25.9 |