Jetson Nano | jetson-inference(识别、检测)

官方教程

https://developer.nvidia.com/embedded/learn/tutorials

安装tensorFlow

https://developer.nvidia.com/zh-cn/embedded/downloads#?search=tensorflow

摄像头实时图像识别

cd jetson-inference/build/aarch64/bin目录下:

./imagenet-console ./images/bird_0.jpg output.jpg

执行等待许久后出现如下(第一次需要很长时间,后面执行就会很快)

实时图像识别演示位于jetson-inference/ aarch64 / bin中并被调用imagenet-camera。它在实时摄像机流上运行,并根据用户参数,使用TensorRT加载googlenet或alexnet。

$  ./imagenet-camera --network=googlenet            #使用googlenet运行 
$  ./imagenet-camera --network=alexnet              #使用alexnet运行

使用DetectNet定位对象坐标

本教程包含以下预训练的DetectNet模型:

  1. ped-100 (single-class pedestrian detector)

  2. multiped-500 (multi-class pedestrian + baggage detector)

  3. facenet-120 (single-class facial recognition detector)

  4. coco-airplane (MS COCO airplane class)

  5. coco-bottle (MS COCO bottle class)

  6. coco-chair (MS COCO chair class)

  7. coco-dog (MS COCO dog class)

#使用预训练的DetectNet-COCO-Dog模型
./detectnet-console --network=coco-dog images/dog_1.jpg output_2.jpg  

./detectnet-console ./images/bottle_0.jpg output_3.jpg --network=coco-bottle

./detectnet-console ./images/airplane_0.jpg output_4.jpg --network=coco-airplane

./detectnet-console ./images/peds_0.jpg output_5.jpg --network=multiped

# pednet和multiped模型识别行人,同时[facenet](http://vis-www.cs.umass.edu/fddb/)识别面孔
$./detectnet-console ./images/peds_0.jpg output_5.jpg --network=multiped
$ ./detectnet-console ./images/peds_3.jpg output_6.jpg --network=multiped
$ ./detectnet-console ./images/peds_3.jpg output_6.jpg --network=facenet

实时摄像头检测
位于jetson-inference/blob/master/detectnet-camera/detectnet-camera.cpp启动

$ ./detectnet-camera --network=facenet         #运行使用面部识别网络

$ ./detectnet-camera --network=multiped        #运行使用多级行人/行李探测器

$ ./detectnet-camera --network=pednet          #运行使用原始单级行人探测器

$ ./detectnet-camera --network=coco-bottle     #在摄像头下检测 瓶/汽水罐

$ ./detectnet-camera --network=coco-dog        #在摄像头下检测狗

注意:要在运行detectnet时获得最佳性能,请通过运行脚本来增加Jetson时钟限制: sudo ~/jetson_clocks.sh

上面执行过程中,第一次执行每个都会执行更新模型,需要花费很长时间,需要大家耐心等待,下次执行就直接执行。

以下是启动程序的一些典型方案:

C ++

$ ./detectnet-camera --network=facenet         #使用FaceNet,默认MIPI CSI相机(1280×720)

$ ./detectnet-camera --camera=/dev/video1 --network=facenet   #使用PedNet,V4L2摄像机/dev/video1(1280x720)

$ ./detectnet-camera --width=640 --height=480 --network=facenet #使用PedNet,默认MIPI CSI摄像机(640x480)

Python

$ python3 detectnet-camera.py --network=facenet     #使用FaceNet,默认MIPI CSI摄像机(1280×720)

$ python3 detectnet-camera.py --network=facenet --camera=/dev/video1     #使用FaceNet,V4L2摄像机/dev/video1(1280x720)

$ python3 detectnet-camera.py --network=facenet --width=640 --height=480 #使用FaceNet,默认为MIPI CSI摄像机(640x480 )

如果视频馈送中未检测到所需的对象,或者您得到的是虚假检测,请尝试使用–threshold参数降低或提高检测阈值(默认值为0.5)。

./detectnet-camera --network=facenet --threshold=0.6

这是Hello AI World教程的最后一步,该教程涵盖了Jetson与TensorRT的推理。

总结一下,我们已经涵盖了:

· 使用图像识别网络对图像进行分类

· 用C ++编写自己的图像识别程序

· 从实时摄像机流中分类视频

· 执行对象检测以定位对象坐标

接下来,我们建议您遵循我们的完整培训+推理教程,该教程还包括在自定义数据集上重新培训这些网络。这样,您可以收集自己的数据,并让模型识别特定于您的应用程序的对象。完整的教程还包括语义分割,它类似于图像分类,但是在每个像素级别上,而不是为整个图像预测一个类。祝好运!

推荐专栏
Jetson Nano学习笔记
Jetson Nano
Jetson Nano
Jetson Nano
Jetson Nano
Jetson Nano
Jetson Nano
Jetson Nano
Jetson Nano

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值