- 一、配置表
- 二、安装openVINO
- 三、lightweight-openpose模型转换
- 四、编译运行
论文翻译、Github源码
一、配置表- NUC8i7(Intel® Core™ i7-8559U CPU @ 2.70GHz × 8 + Intel® Iris® Plus Graphics 655 (CFL GT3))
- ubuntu18.04
- Anaconda3(python3.6)
- openVINO(2019.3.376/2019 R3.1)
ps:如果使用最新版本的2021.4 LTS反而占用资源全满,帧率不足15帧,目前不清楚怎么回事。使用2019版本,CPU可以跑到26帧,加核显GPU可以跑到33帧(程序限制了)。
- 卸载旧的openVINO
cd /opt/intel/openvino/openvino_toolkit_uninstaller sudo ./uninstall_GUI.sh 删除环境变量
- 安装openVINO
官网
参考博客
-
下载源码
官方Github -
下载模型
参考博客 -
将PyTorch模型转换为ONNX格式
cd ~/lightweight-human-pose-estimation/ python scripts/convert_to_onnx.py --checkpoint-path models/checkpoint_iter_370000.pth
会在lightweight-human-pose-estimation目录下生成human-pose-estimation.onnx文件,将其移到~/lightweight-human-pose-estimation/models下面。
- 将ONNX格式模型转换为OpenVINO格式
/opt/intel/openvino/deployment_tools/model_optimizer/mo.py --input_model ~/lightweight-human-pose-estimation/models/human-pose-estimation.onnx --input data --mean_values data[128.0,128.0,128.0] --scale_values data[256] --output stage_1_output_0_pafs,stage_1_output_1_heatmaps
将生成的.xml文件、.mapping文件、.bin文件放在models下面。
- 编译
cd /opt/intel/openvino_2019.3.376/inference_engine/demos/ bash build_demos.sh
安装必要的依赖,生成在home下的omz_demos_build中。
- 运行视频
cd ~/omz_demos_build/intel64/Release ./human_pose_estimation_demo -m/human-pose-estimation.xml -i /yourvideo.mp4
- 使用摄像头
cd ~/omz_demos_build/intel64/Release ./human_pose_estimation_demo -m/human-pose-estimation.xml -i cam
ps:可以使用-d GPU,会自动调用核显或者集显。
3.1 不使用GPU(小于20帧,有一般核心资源占用超过50%)
3.2 使用核显GPU(程序满帧率33帧,GPU占用50%,CPU占用不到20%)



