Metadata-Version: 2.4
Name: depthai-nodes
Version: 0.9.0
Summary: Community on-host nodes for DepthAI.
Author-email: Luxonis <support@luxonis.com>
Maintainer-email: Luxonis <support@luxonis.com>
License-Expression: Apache-2.0
Project-URL: repository, https://github.com/luxonis/depthai-nodes
Project-URL: issues, https://github.com/luxonis/depthai-nodes/issues
Keywords: ml,postprocessing,luxonis,oak
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: depthai>=3.12.0
Requires-Dist: opencv-python-headless~=4.10.0
Requires-Dist: numpy>=1.22
Provides-Extra: dev
Requires-Dist: pre-commit<4.0.0,>=3.2.1; extra == "dev"
Requires-Dist: pydoctor==25.10.1; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-subtests>=0.12.1; extra == "dev"
Requires-Dist: pytest-md>=0.2.0; extra == "dev"
Requires-Dist: coverage-badge>=1.1.0; extra == "dev"
Requires-Dist: b2==3.16.1; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
Requires-Dist: hubai-sdk>=0.3.4; extra == "dev"
Provides-Extra: box-measurement
Requires-Dist: open3d>=0.20; extra == "box-measurement"
Provides-Extra: measure-anything
Requires-Dist: numpy==2.2.6; extra == "measure-anything"
Requires-Dist: scipy==1.15.3; extra == "measure-anything"
Requires-Dist: opencv-python-headless==4.10.0.84; extra == "measure-anything"
Dynamic: license-file

# DepthAI Nodes

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

![CI](https://github.com/luxonis/depthai-nodes/actions/workflows/ci.yaml/badge.svg?event=pull_request)
[![codecov](https://codecov.io/gh/luxonis/depthai-nodes/graph/badge.svg?token=ZG493MZ07B)](https://codecov.io/gh/luxonis/depthai-nodes)

[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Docformatter](https://img.shields.io/badge/%20formatter-docformatter-fedcba.svg)](https://github.com/PyCQA/docformatter)

<a name="overview"></a>

## 🌟 Overview

DepthAI Nodes provides reusable nodes and helpers for **DepthAI v3** pipelines, including neural network post-processing, image utilities, message handling, and runtime integrations. Inference helpers support both native DepthAI parsers and Python host parsers.

For complete Python API documentation, see the [DepthAINodes documentation and API reference](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/).

## 📜 Table of Contents

- [🌟 Overview](#overview)
- [🛠️ Installation](#installation)
- [📦 Content](#-content)
  - [📨 Message](#-message)
  - [🧩 Node](#-node)
  - [Runtime](#runtime)
- [🤝 Contributing](#-contributing)

<a name="installation"></a>

## 🛠️ Installation

Requires Python 3.10 or newer. We use Python 3.12 for development and release
builds, and CI tests Python 3.10, 3.12, and 3.14.

Install from PyPI:

```bash
pip install depthai-nodes
```

### Box measurement

The box measurement and support plane nodes need open3d. Install it with the `box-measurement` extra:

```bash
pip install "depthai-nodes[box-measurement]"
```

On Debian or Ubuntu, open3d also needs system libraries that minimal images such as Docker containers and CI runners often lack:

```bash
sudo apt-get install libegl1 libgl1 libgomp1
```

open3d 0.20 publishes Linux wheels only for glibc 2.35 or newer, such as Debian 12+ or Ubuntu 22.04+. On older systems, including Debian 11, Ubuntu 20.04 and JetPack 5, pip cannot find a matching open3d and the install fails.

### MeasureAnything

Install the dependencies for `MeasureAnythingDetector` and `MeasureAnythingDimensioner` with the `measure-anything` extra:

```bash
pip install "depthai-nodes[measure-anything]"
```

See the [interactive algorithm guide](depthai_nodes/algorithms/measure_anything/implementation/visualization.html)
for processing steps, accuracy and performance, and the
[implementation record](docs/measure-anything/implementation.md) for provenance
and verification coverage.

For RGB-aligned depth, use the shared
[axial-depth correction](docs/axial-depth-correction.md) before PointCloud.
The [deterministic pipeline example](examples/image_align_depth_correction)
runs on the host and in an OAK-4 standalone app.

### From source

Install from source:

```bash
git clone https://github.com/luxonis/depthai-nodes.git
cd depthai-nodes
pip install .
```

## 📦 Content

### 📨 Message

The `message` module provides `Collection`, `GatheredData`, and `SnapData`
messages, support plane messages such as `SupportPlane` and
`SupportPlaneCalibrationResult`, box measurement messages such as
`BoxDetections` and `BoxMeasurements`, plus creator functions for native DepthAI parser messages. Creators
cover detections, segmentation, classification, keypoints, maps, and other model
outputs. See the [message package documentation](./depthai_nodes/message/__init__.py) for the available
types and their roles.

### 🧩 Node

The `node` module provides parsers and pipeline helpers:

- **Parser nodes** handle model post-processing for architectures such as YOLO, MediaPipe, and YuNet.
- **Inference helpers**, including `ParsingNeuralNetwork` and `ParserGenerator`, create and connect inference and parser nodes.
- **Utility nodes** handle detection filtering, image overlays, colormaps, and message collection.
- **Support plane nodes** find the support plane in a point cloud, checked against gravity from IMU data. `AutoSupportPlane` finds and holds the support plane, and can optionally check and refit it. `SupportPlaneCalibrator` and `AutoSupportPlane` require open3d.
- **Box measurement nodes** detect, track, and measure boxes from color and a point cloud. `BoxDetector` and `BoxMeasurer` run on RVC4 only. `BoxDimensioner` requires open3d and has no RVC4-only check.

`ParsingNeuralNetwork` and `ParserGenerator` use native DepthAI parsers by default. Use `HostParsingNeuralNetwork` or pass `hostOnly=True` to `ParserGenerator.build()` to select this package's host parsers.

See the [node package documentation](./depthai_nodes/node/__init__.py) for available nodes and examples.

### Runtime

The `runtime` module contains runtime integrations. Its OAK4 QNN helper
creates ONNX Runtime sessions on the Hexagon DSP when used with the
`onnxruntime` variant of the `oakapp-base` image:

```python
from depthai_nodes.runtime import onnx_qnn_session

session = onnx_qnn_session("model.onnx")
```

`serve_frontend` hosts a built custom frontend alongside a DepthAI pipeline.
Build it first with `cd frontend && npm ci && npm run build`, then:

```python
from pathlib import Path

import depthai as dai
from depthai_nodes.runtime import serve_frontend

with serve_frontend(Path(__file__).resolve().parent / "frontend" / "dist"):
    visualizer = dai.RemoteConnection(serveFrontend=False)
    # Initialize the device and run the application's pipeline here.
```

The context manager serves assets and browser routes at `http://localhost:8082`
and stops on exit, including exceptions. Set `host` and `port` to customize the
address, or `enabled=False` when another server handles hosting. It serves HTTP
files only; the frontend connects to `RemoteConnection` separately for live data.

## 🤝 Contributing

See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup, parser guidelines, and testing instructions. Feedback and bug reports are welcome in [GitHub issues](https://github.com/luxonis/depthai-nodes/issues).
