【问题标题】:How to get separate values from type "jetson.inference.detectNet.Detection"?如何从“jetson.inference.detectNet.Detection”类型中获取单独的值?
【发布时间】:2020-06-09 05:42:46
【问题描述】:

我在我的 Jetson Nano 上使用 DetectNet,效果很好。 net.Detect() 函数返回一个列表,其中每个对象都来自“jetson.inference.detectNet.Detection”类型。当我打印它时:

<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] 这样的行不起作用,因为它不是一个数组。我想计算检测到每个类的对象数量。谢谢!

【问题讨论】:

    标签: python object types object-detection detection


    【解决方案1】:

    一旦你有了检测对象,你就可以通过名字访问它的成员,例如:

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

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-22
      • 2011-10-21
      • 1970-01-01
      • 2018-05-26
      • 2021-11-12
      • 2016-02-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多