AI学习库的安装jetson-inference

https://mp.csdn.net/console/editor/html/107425573

AI学习库的安装jetson-inference(国内详细教程)

阅读目录

 


源码在github上,

链接:https://github.com/dusty-nv/jetson-inference

但是在国内往往下载时会出现问题,我已经讲最新的源码项目移植到了码云,

链接:https://gitee.com/zhongxon/jetson-inference

安装方式相同。

回到顶部

1、安装cmake

$sudo apt update

$sudo apt upgrade

$sudo apt-get install cmake

回到顶部

2、源码的获取

github获取

先试着从GitHub上获取源码

$git clone https://github.com/dusty-nv/jetson-inference

码云获取

如果GitHub上获取源码失败,可以从我的码云上获取,执行如下代码即可,一样

$git clone https://gitee.com/zhongxon/jetson-inference

获取源码后

$cd jetson-inference

$git submodule update --init

在执行git submodule update --init后可能有文题可以参考GitHub登不上去问题解决办法

回到顶部

3、换源

路径切换到jetson-inference/tools

$cd jetson-inference/tools

模型下载的国内源(在以上路径下)

$sed -in-place -e 's@https://nvidia.box.com/shared/static@https://bbs.gpuworld.cn/mirror@g' download-models.sh

安装pytorch,此时只是添加了源可以在第四步build文件夹中安装。

$sed -in-place -e 's@https://nvidia.box.com/shared/static@https://bbs.gpuworld.cn/mirror@g' install-pytorch.sh

sed -in-place -e 's@https://github.com/pytorch/vision@https://gitee.com/vcan123/pytorch@g' install-pytorch.sh(不必做)

$sed -in-place -e 's@https://github.com/dusty-nv/vision@https://gitee.com/vcan123/dusty-nv@g'

install-pytorch.sh(不必做)

、编译安装

$sudo apt-get update

$sudo apt-get install git cmake libpython3-dev python3-numpy(不必做)

$cd jetson-inference

$mkdir build

$cd build

$cmake ../               (非常块)

$make

$sudo make install       (也有下载过程,但很快)

执行以上过程时出现如图所示,根据自己的需要点确定就可以。我全部下载,共45个。

下载后有4.7G,此时AGX  Xavier只剩下8.3G空间。

 

5、物体识别

物体识别在路径jetson-inference/build/aarch64/bin

静态物体识别

图片也可选,在bin路径下有images文件,橘子等的图片都在里边。

打开终端输入

c++:

$ ./imagenet-console --network = googlenet images/orange_0.jpg output_0.jpg   -- network标志是可选的

python:

$ ./imagenet-console.py --network = googlenet images/orange_0.jpg output_0.jpg   -- network标志是可选的

$display output_0.jpg

静态图像识别测试脚本:

$ vi static_picture.sh

内容如下:

#/bin/sh

 

 ./imagenet-console $1 output_$1

 display output_$1

添加执行权限和运行上边的脚本:

$ chmod a+x ./static_picture.sh

$ ./static_picture.sh orange_0.jpg

动态物体识别

支持USB摄像头基本都可用,CSI摄像头(树莓派的)

$ ./imagenet-camera googlenet

$ ./imagenet-camera alexnet

如果使用USB摄像头,需要修改imagenet-camera.cpp中的宏定义DEFAULT_CAMERA,然后重新编译。

定位对象坐标

检测出对象病提取边框

$ ./detectnet-console dog_1.jpg output_1.jpg coco-dog

从网络上,尤其CSDN找了很多参考资料,加以整理,验证。

重点参考:https://www.cnblogs.com/vcan123/p/13269218.html  Yimiu大侠的文章。

 

有问题欢迎交流。

唐山深度科技有限公司  (内部资料)

王晓明 zhongxon

微信:199663740

手机:13582524826

2020.07.18

 

  • 5
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值