DepthAI V3

安装
Linux / MacOS
1. Install DepthAI v3
Command Line
1git clone https://github.com/luxonis/depthai-core.git && cd depthai-core
2python3 -m venv venv
3source venv/bin/activate
4# Installs library and requirements
5python3 examples/python/install_requirements.pyCommand Line
1pip install depthai --force-reinstall2. Run an example
After installing the library, you can run an example, eg. Detection Network example or Display all cameras:
Command Line
1cd examples/python
2# Run YoloV6 detection example
3python3 DetectionNetwork/detection_network.py
4# Display all camera streams
5python3 Camera/camera_all.pyDeveloping with C++?
DepthAI v3 is largely written in C++. The build instructions are available on the depthai-core repository.
Github page组件

部署 AI 模型
预训练模型
自定义模型
- (推荐)通过 HubAI 在线转换
- 通过 ModelConverter 离线转换 (
nn_archive.tar.xz)——HubAI 底层使用此工具,但 HubAI 更易用 - 直接使用 SNPE 工具 (
.dlc)——ModelConverter 在 RVC4 平台上底层使用 SNPE
.dlc,可以通过编辑以下代码片段将其部署到 OAK4 上:NeuralNetwork 示例:Python
1nn = pipeline.create(dai.node.NeuralNetwork)
2nn.setModelPath('my_model.dlc')
3nn.setBackend("snpe") # 指定 SNPE NN 后端。通常会在底层自动设置
4# 指定 SNPE (RVC4) 特定设置,如 DSP 运行时和 NN 性能配置文件
5nn.setBackendProperties({"runtime": "dsp", "performance_profile": "default"})archive.tar.xz,可以用以下代码片段编辑该示例:Python
1cam = pipeline.create(dai.node.Camera).build(socket)
2# 如果你的神经网络模型需要 640x640 的输入尺寸(BGR):
3cam_out = cam.requestOutput((640, 640), dai.ImgFrame.Type.BGR888p)
4
5nn_archive = dai.NNArchive('./my_nn_archive.tar.xz')
6nn = pipeline.create(dai.node.NeuralNetwork).build(cam_out, nn_archive)