常见问题

TensorRT 板载摄像头实时图像识别教程

2022-04-27 admin

1、进入执行的目录

假如你在 jetson-inference 目录下请执行以下目录。

cd build/aarch64/bin/


 

2、执行图像识别命令

这个时候最好能通过桌面执行,否则可能看不到摄像头的界面,或者通过 VNC 远程桌面连接。

 

进入到 jetson-inference/ aarch64 / bin 目录下:

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

 

 


每秒帧数FPS,来自视频的分类对象名称和分类对象的置信度被打印到 openGL 口标题栏。默认情况下,应用程序可以识别多达1000 种不同类型的对象,因为Googlenet Alexnet 是在包含 1000 类对象的ILSVRC12 ImageNet 数据库上进行培训的。1000 种类型对象的名称映射,可以在repo 下找到 data/networks/ilsvrc12_synset_words.txt


 

 

这样识别到物体就会在上面显示物体英文名称,百分数就是匹配百分比。

 

如果安装新摄像头外壳会出现视频画面颠倒,可用以下方法设置修改:


$ cd ~/jetson-inference/utils/camera/

$ gedit gstCamera.cpp

``` 

- Change the folloing code:

```bash

#if NV_TENSORRT_MAJOR > 1 && NV_TENSORRT_MAJOR < 5 // if

JetPack 3.1-3.3 (different flip-method)

const int flipMethod = 0; // Xavier (w/TRT5) camera is mounted inverted #else

const int flipMethod = 2; #endif

改成以下:

#if NV_TENSORRT_MAJOR > 1 && NV_TENSORRT_MAJOR < 5 // if

JetPack 3.1-3.3 (different flip-method)

const int flipMethod = 0; // Xavier (w/TRT5) camera is mounted inverted #else

const int flipMethod = 0; //2 变成 0

#endif

```

Build the Code:

```bash

$ cd ~/jetson-inference/build/

$ make

$sudo make install


首页
产品
案例
联系