常见问题

使用 DetectNet 定位对象坐标

2022-04-27 admin


先前的图像识别示例输出表示整个输入图像的类概率。我们在本教程中强调的第二个深度学习功能是检测对象,并找到视频中这些对象所在的位置(即提取其边界框)。这是使用'detectNet' - 或对象检测/本地化网络执行的。

detectNet 对象接受 2D 图像作为输入,并输出检测到的边界框的坐标列表。为了训练对象检测模型,首先使用预训练的ImageNet 识别模型( Googlenet以及除了源图像之外的训练数据集中包括的边界坐标标签。

本教程包含以下预训练的 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 的控制台程序和相机流程序。

 

从命令行检测对象

 

detectnet-console 程序可用于查找图像中的对象。要加载repo 附带的预训练对象检测模型之一,可以将预训练模型名称指定为第 3 个参数 detectnet-console

$ ./detectnet-console ./images/dog_1.jpg output_2.jpg --network=coco-dog

上面的命令将处理 dog_1.jpg,使用预训练的 DetectNet-COCO-Dog 模型将其保存到

output_2.jpg。这是各种各样的快捷方式,因此如果您不愿意,您不需要自己训练模型。


 

 

 

 

提供预训练的 DetectNet 模型

下面是使用 repo 下载的预训练的 DetectNet 快照表位于data/networks 运行 cmake 骤后的目录中以及 detectnet-console 用于加载预训练模型的相关参数:

DIGITS model

CLI argument

classes

DetectNet-COCO-Airplane

 

coco-airplane

 

airplanes

DetectNet-COCO-Bottle

 

coco-bottle

bottles

DetectNet-COCO-Chair

 

coco-chair

chairs

DetectNet-COCO-Dog

 

coco-dog

dogs

ped-100

 

pednet

pedestrians

multiped-500

 

multiped

pedestrians, luggage

facenet-120

 

facenet

faces

这些都已经应用了上面的 python 层补丁。

Jetson 上运行其他 MS-COCO 模型


 

 

让我们尝试运行一些其他 COCO 模型。这些培训数据都包含在上面下载的数据集中。虽然上面的DIGITS 训练示例是针对 coco-dog 模型的,但是可以遵循相同的程序来训练DetectNet 对样本 COCO 数据集中包含的其他类。

 

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

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

 

 

 

Jetson 上运行行人模型

回购中还包括预训练的 DetectNet 模型以检测人类。这些 pednet multiped 模型识别行人,同时 facenet 识别面孔来自 FDDB。以下是在拥挤的空间中同时检测多个人的示例:

$./detectnet-console ./images/peds_0.jpg output_5.jpg --network=multipe


 

 

多类目标检测模型

使用多重模型(PEDNET_MULTI)时,对于包含行李或行李以及行人的图像,第二个对象类将使用绿色叠加层渲染。


$ ./detectnet-console ./images/peds_3.jpg output_6.jpg
 --network=multiped


首页
产品
案例
联系