DepthAI v2 has been superseded by DepthAI v3. You are viewing legacy documentation.

本页目录

  • 如何放置
  • 输入与输出
  • 使用方式
  • 功能示例
  • 参考

YoloDetectionNetwork

YoloDetectionNetwork 节点通过增加 YOLO NN 结果解码(在 OAK 设备上执行)来扩展 NeuralNetwork 节点。
这意味着该节点的 Out 输出不再是 NNData(字节数组),而是 ImgDetections,可以在代码中轻松使用。

如何放置

Python

Python
1pipeline = dai.Pipeline()
2yoloDet = pipeline.create(dai.node.YoloDetectionNetwork)

C++

C++
1dai::Pipeline pipeline;
2auto yoloDet = pipeline.create<dai::node::YoloDetectionNetwork>();

输入与输出

使用方式

Python

Python
1pipeline = dai.Pipeline()
2yoloDet = pipeline.create(dai.node.YoloDetectionNetwork)
3yoloDet.setBlobPath(nnBlobPath)
4
5# Yolo 特有参数
6yoloDet.setConfidenceThreshold(0.5)
7yoloDet.setNumClasses(80)
8yoloDet.setCoordinateSize(4)
9yoloDet.setAnchors([10,14, 23,27, 37,58, 81,82, 135,169, 344,319])
10yoloDet.setAnchorMasks({"side26": [1, 2, 3], "side13": [3, 4, 5]})
11yoloDet.setIouThreshold(0.5)

C++

C++
1dai::Pipeline pipeline;
2auto yoloDet = pipeline.create<dai::node::YoloDetectionNetwork>();
3yoloDet->setBlobPath(nnBlobPath);
4
5// Yolo 特有参数
6yoloDet->setConfidenceThreshold(0.5f);
7yoloDet->setNumClasses(80);
8yoloDet->setCoordinateSize(4);
9yoloDet->setAnchors({10, 14, 23, 27, 37, 58, 81, 82, 135, 169, 344, 319});
10yoloDet->setAnchorMasks({{"side13", {3, 4, 5}}, {"side26", {1, 2, 3}}});
11yoloDet->setIouThreshold(0.5f);

功能示例

参考

需要帮助?

请前往 OAKChina 官网 获取技术支持或解答您的任何疑问。