如何从 "jetson.inference.detectNet.Detect "类型中获取单独的值?

问题描述 投票:1回答:1

我在Jetson Nano上使用DetectNet,效果很好。探测网的 net.Detect() funcion返回一个列表,其中每个对象都来自 "jetson.inference.detectNet.Detect "类型。当我打印出来的时候。

<detectNet.Detection object>
   -- ClassID: 1
   -- Confidence: 0.808974
   -- Left:    416.31
   -- Top:     218.694
   -- Right:   593.188
   -- Bottom:  703.127
   -- Width:   176.878
   -- Height:  484.433
   -- Area:    85685.7
   -- Center:  (504.749, 460.91)

现在我的问题是:我怎样才能分别访问这些值(例如,只有ClassID,在这种情况下,应该是1)?像detection[0][0]这样的行不能用,因为它不是一个数组。我想计算每个类有多少对象被检测到。谢谢!我在我的JPG上使用DetectNet。

python object types object-detection detection
1个回答
0
投票

一旦你有了Detect对象,你就可以通过名字来访问它的成员,比如说。

top = detection.Top # with capital letters, just as they are shown by the print() statement.

希望能帮到你

© www.soinside.com 2019 - 2024. All rights reserved.