首页 > 其他分享 >Jestson Nano上基于openvino推理

Jestson Nano上基于openvino推理

时间:2023-10-16 20:36:14浏览次数:27  
标签:openvino Nano Jestson debian9 cf2c7da5689 arm64 samples 2022.3

intel NCS2计算棒是由openvino支持的,但是目前openvino只有2022.3.1版本支持NCS2了,之后的版本都不支持计算棒了。

本文记录一下再NVIDIA Jetson Nano上用openvino实现NCS2的调用。
通过交叉编译openvino samples,通过benchmark app实现模型推理。

环境配置

  1. openvino归档文件,可以再这个链接上下载

    1697453851285.png

    然后解压

    wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2022.3.1/linux/l_openvino_toolkit_debian9_2022.3.1.9227.cf2c7da5689_arm64.tgz
    
    tar -zxvf l_openvino_toolkit_debian9_2022.3.1.9227.cf2c7da5689_arm64.tgz
    
  2. 安装openvino依赖

    cd l_openvino_toolkit_debian9_2022.3.1.9227.cf2c7da5689_arm64/install_dependencies
    sudo -E ./install_openvino_dependencies.sh
    
  3. 确保一个python 3.7或者3.9版本

  4. 确保cmake版本高于3.13,否则会报错。Jetson Nano上的cmake只有3.10,我手动安装了一个

编译openvino samples

直接进入samples/cpp,直接在板子上编译太慢了,幸好项目不大。

export PATH=/home/yanghuan/Downloads/cmake-3.28.0-rc1-linux-aarch64/bin:$PATH
export LD_LIBRARY_PATH=/home/yanghuan/Downloads/l_openvino_toolkit_debian9_2022.3.1.9227.cf2c7da5689_arm64/runtime/lib/aarch64:$LD_LIBRARY_PATH
cd l_openvino_toolkit_debian9_2022.3.1.9227.cf2c7da5689_arm64/samples/cpp
./build_samples.sh -i bin/ -b build/

这样在bin/目录下就是可执行文件了。

1697457565868.png

配置NCS2

这里参考官网文档

最后重启插上NCS2。

export LD_LIBRARY_PATH=/home/yanghuan/Downloads/l_openvino_toolkit_debian9_2022.3.1.9227.cf2c7da5689_arm64/runtime/lib/aarch64:$LD_LIBRARY_PATH
cd ~/Downloads/l_openvino_toolkit_debian9_2022.3.1.9227.cf2c7da5689_arm64/samples/cpp/bin/samples_bin
# 查询设备
 ./hello_query_device

1697458010558.png

测试模型延迟

这里提交一个mobilenetv2的模型试试

  1. NCS2推理

    ./benchmark_app \
    -m /home/yanghuan/Downloads/mobilenet_v2.onnx \
    -d MYRIAD \
    -b 1 \
    -shape [1,3,256,256] \
    -hint latency \
    -niter 10
    

    1697458463327.png

  2. CPU推理

    ./benchmark_app \
    -m /home/yanghuan/Downloads/mobilenet_v2.onnx \
    -d CPU \
    -b 1 \
    -shape [1,3,256,256] \
    -hint latency \
    -niter 10
    -nthreads 2
    

    1697458561178.png

标签:openvino,Nano,Jestson,debian9,cf2c7da5689,arm64,samples,2022.3
From: https://www.cnblogs.com/sheephuan/p/17768270.html

相关文章

  • 为.NET打开新大门:OpenVINO.NET开源项目全新发布
    在AI的应用越来越广泛的今天,优化深度学习模型并进行推理部署已经成为了一门必要的技术。Intel开发的OpenVINO工具包(OpenVisualInferenceandNeuralnetworkOptimization)就是这样一款强大的工具。作为一个开源的工具包,OpenVINO为开发者提供了强大的深度学习模型优化和推理功能,......
  • 为.NET打开新大门:OpenVINO.NET开源项目全新发布
    为.NET打开新大门:OpenVINO.NET开源项目全新发布在AI的应用越来越广泛的今天,优化深度学习模型并进行推理部署已经成为了一门必要的技术。Intel开发的OpenVINO工具包(OpenVisualInferenceandNeuralnetworkOptimization)就是这样一款强大的工具。作为一个开源的工具包,OpenVINO为......
  • TUXEDO宣布Nano Pro Gen12迷你Linux PC搭载AMD Ryzen 7000U处理器
    导读这款迷你PC还配备了AMDMediatekWi-Fi6E三频带芯片,为坚定的AMD粉丝提供了更多选择。TUXEDOComputers今天宣布了NanoPro迷你PC的第12代(Gen12),内部配置升级,连接性改进,计算效率提高。与2021年11月宣布的NanoProGen11相比,NanoProGen12迷你电脑拥有更强大、更高效......
  • C# OpenVino Yolov8 Seg 分割
    效果 项目代码usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingOpenCvSharp;namespaceOpenVino_Yolov8_Demo{publi......
  • C# OpenVinoSharp PP-TinyPose 人体姿态识别
    效果项目部分代码usingOpenCvSharp;usingOpenCvSharp.Extensions;usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespace......
  • C# OpenVino Yolov8 Detect 目标检测
    效果项目 代码usingOpenCvSharp;usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingstaticSystem.Net.Mime.MediaTypeName......
  • openvino概述
    下面是openvinocpu、集成显卡、神经棒的性能:         使用openvino的时候,你的模型一般都是.pt等等格式,可以先转为onnx格式,再基于ModelOptimizer转为IR格式(xml+bin);另外,模型优化器还能优化网络结构(水平、垂直融合,添加、删除一个or多个层)   ......
  • openvino道路分割
    我这里仅显示道路和车道线1mask=np.zeros((hh,ww,3),dtype=np.uint8)2mask[np.where(res>0)]=(0,255,0)#路面3mask[np.where(res>1)]=(255,0,0)#车道线 模型的下载还是老方法AccuracyThequalitymetricscalculatedon500imagesfrom"Might......
  • MacOS 使用 Asan 编译 C++报警告malloc: nano zone abandoned due to inability to re
    问题clang(llvm)编译c++程序,带内存问题检查工具选项-fsanitize=address-fsanitize=undefined之后出现:malloc:nanozoneabandonedduetoinabilitytoreservevmspace.解决vi~/.zshrc#加入:exportMallocNanoZone=0source~/.zshrc参考:ios-malloc:nanozonea......
  • 全志H3-nanopi-duo2开发板GPIO驱动开发
    原文:https://blog.csdn.net/weixin_52668204/article/details/1305634211:获取对应开发板duo2的内核源码从官网获取[friendlyarm的nanopi-duo2](https://wiki.friendlyelec.com/wiki/index.php/NanoPi_Duo2/zh#.E5.AE.9A.E5.88.B6.E5.91.BD.E4.BB.A4.E8.A1.8C.E7.9A.84.E6.AC.A2.......