< >
Home » ROS2与深度学习教程 » ros2与深度学习教程-整合openvino kit

ros2与深度学习教程-整合openvino kit

ros2与深度学习教程-整合openvino kit

说明:

  • 介绍如何在ubuntu 20.04的ros2版本foxy下整合openvino kit
  • 测试环境:nuc ubuntu 20.04

安装openvinokit步骤:

请输入图片描述

  • 再填写邮箱,提交即可下载。
  • 或者使用我们这个版本,这个离线安装版本有600多M
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18319/l_openvino_toolkit_p_2021.4.752.tgz
  • 解压包
tar -xvzf l_openvino_toolkit_p_2021.4.752.tgz
  • 进入目录
cd l_openvino_toolkit_p_2021.4.752
  • 运行界面安装,推荐
sudo ./install_GUI.sh
  • 打开界面

请输入图片描述

  • 根据提示,一步步完成安装
  • 安装完成界面

请输入图片描述

  • 安装位置
For root or administrator: /opt/intel/openvino_<version>/
For regular users: /home/<USER>/intel/openvino_<version>/
  • 安装额外的依赖
cd /opt/intel/openvino_2021/install_dependencies
sudo -E ./install_openvino_dependencies.sh
  • 加载环境
source /opt/intel/openvino_2021/bin/setupvars.sh
  • 或者增加加载脚本到bashrc
vim ~/.bashrc
source /opt/intel/openvino_2021/bin/setupvars.sh
  • 输入:wq 保存

  • 配置模型优化

  • 可以针对 Caffe, TensorFlow 2.x, MXNet, Kaldi, and ONNX做优化

cd /opt/intel/openvino_2021/deployment_tools/model_optimizer/install_prerequisites
sudo ./install_prerequisites.sh

测试例子:

  • 编译demo
 # root is required instead of sudo
 source /opt/intel/openvino_2021/bin/setupvars.sh
 cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/demos
 source build_demos.sh
  • 编译后执行文件的位置
/home/ubuntu/omz_demos_build/intel64/Release
  • 下载模型
  • 进入open_model_zoo路径
cd /opt/intel/openvino_2021/deployment_tools/open_model_zoo/tools/downloader
  • 查看所有模型
./downloader.py --print_all
  • 下载face-detection模型:
sudo ./downloader.py --name face-detection-retail-0004
  • 目录位于:
 /opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/intel/face-detection-retail-0004/FP32/face-detection-retail-0004.xml
  • 下载视频例子
mkdir -p ~/tools/openvino
cd ~/tools/openvino
git clone https://github.com/intel-iot-devkit/sample-videos.git
  • 运行例子
#进入目录
cd ~/omz_demos_build/intel64/Release
#source环境
source /opt/intel/openvino_2021/bin/setupvars.sh
#执行例子
./multi_channel_face_detection_demo -m /opt/intel/openvino_2021.4.752/deployment_tools/open_model_zoo/tools/downloader/intel/face-detection-retail-0004/FP16-INT8/face-detection-retail-0004.xml -d CPU -i ~/tools/openvino/sample-videos/head-pose-face-detection-female-and-male.mp4 -i ~/tools/openvino/sample-videos/head-pose-face-detection-female.mp4 -i ~/tools/openvino/sample-videos/head-pose-face-detection-male.mp4 -i ~/tools/openvino/sample-videos/people-detection.mp4 -i ~/tools/openvino/sample-videos/face-demographics-walking-and-pause.mp4 -i ~/tools/openvino/sample-videos/face-demographics-walking.mp4
  • 成功执行之后,显示一个界面,标识人脸。
  • 更多例子介绍:https://docs.openvino.ai/latest/omz_demos.html

参考:

  • https://docs.openvino.ai/latest/openvino_docs_install_guides_installing_openvino_linux.html#install-openvino
  • https://github.com/intel/ros2_openvino_toolkit/blob/master/doc/getting_started_with_Foxy_Ubuntu20.04.md
  • https://docs.openvino.ai/latest/model_zoo.html
  • https://github.com/openvinotoolkit/open_model_zoo/
  • https://docs.openvino.ai/latest/get_started.html

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ros2与深度学习教程