haybale-visiongraph 0.0.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- haybale_visiongraph-0.0.26/.gitignore +28 -0
- haybale_visiongraph-0.0.26/PKG-INFO +65 -0
- haybale_visiongraph-0.0.26/README.md +46 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/OVERVIEW.md +33 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/QUICKREF.md +30 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/__init__.py +80 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/adapters/frame_adapters.py +56 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.adapter.GrayToRgbAdapter.md +15 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.adapter.RgbToGrayAdapter.md +15 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.AnnotateNode.md +40 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.FrameDisplayNode.md +36 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.NumpyFrameEventNode.md +31 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.OakDCameraNode.md +80 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.ObjectDetectorNode.md +22 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.PoseEstimatorNode.md +22 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.SegmentationNode.md +22 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.TrackerNode.md +31 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.node.WebCameraNode.md +40 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.DEPTH_FRAME.md +18 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.DETECTION_RESULT.md +16 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.GRAY_FRAME.md +15 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.LANDMARK_RESULT.md +16 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.MULTIFRAME_CALLBACK.md +21 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.POSE_RESULT.md +16 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.RGB_FRAME.md +15 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.SEGMENTATION_RESULT.md +16 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.type.VISION_RESULT.md +16 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/docs/visiongraph.widget.NumpyViewerWidget.md +33 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/help/opencv_viewer_architecture.md +592 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/__init__.py +22 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/annotate_node.py +155 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/base_estimator_node.py +266 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/numpy_frame_display_node.py +144 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/numpy_frame_event_node.py +182 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/oak_d_camera_node.py +735 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/object_detector_node.py +59 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/pose_estimator_node.py +53 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/segmentation_node.py +47 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/tracker_node.py +200 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/nodes/web_cam_node.py +290 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/py.typed +0 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/types/__init__.py +25 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/types/frame_type.py +114 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/types/multiframe_callback_type.py +53 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/types/result_type.py +124 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/widgets/__init__.py +10 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/widgets/components/numpy_viewer.js +265 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/widgets/components/streaming_viewer.py +273 -0
- haybale_visiongraph-0.0.26/haybale_visiongraph/widgets/numpy_viewer_widget.py +93 -0
- haybale_visiongraph-0.0.26/pyproject.toml +35 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
env/
|
|
16
|
+
|
|
17
|
+
# Test / type-check caches
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
.ruff_cache/
|
|
20
|
+
.mypy_cache/
|
|
21
|
+
.tox/
|
|
22
|
+
.coverage
|
|
23
|
+
htmlcov/
|
|
24
|
+
|
|
25
|
+
# Editor / OS
|
|
26
|
+
.DS_Store
|
|
27
|
+
.idea/
|
|
28
|
+
.vscode/
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: haybale-visiongraph
|
|
3
|
+
Version: 0.0.26
|
|
4
|
+
Summary: Visiongraph library for Haywire node system demonstrating custom types, nodes, widgets, and renderers
|
|
5
|
+
Author: Haywire Team
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: haywire,node-editor,visiongraph,visual-programming
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Requires-Dist: depthai~=2.30
|
|
10
|
+
Requires-Dist: fastapi
|
|
11
|
+
Requires-Dist: haybale-core>=0.0.32
|
|
12
|
+
Requires-Dist: haywire-core>=0.0.32
|
|
13
|
+
Requires-Dist: nicegui>=3.12.1
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
Requires-Dist: opencv-contrib-python>=5.0.0.93
|
|
16
|
+
Requires-Dist: typing-extensions>=4.15.0
|
|
17
|
+
Requires-Dist: visiongraph[mediapipe,onnx,openvino]
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# Visiongraph
|
|
21
|
+
|
|
22
|
+
<!-- marketstall:share-url:start -->
|
|
23
|
+
```sh
|
|
24
|
+
# Released packages (recommended):
|
|
25
|
+
https://going-haywire.github.io/haybale-visiongraph/marketplace.toml
|
|
26
|
+
|
|
27
|
+
# Always the latest (tracks the current branch):
|
|
28
|
+
https://github.com/going-haywire/haybale-visiongraph/blob/master/marketstall.toml
|
|
29
|
+
|
|
30
|
+
# Frozen to this version:
|
|
31
|
+
https://github.com/going-haywire/haybale-visiongraph/blob/v0.0.26/marketstall.toml
|
|
32
|
+
```
|
|
33
|
+
<!-- marketstall:share-url:end -->
|
|
34
|
+
|
|
35
|
+
Visiongraph library
|
|
36
|
+
|
|
37
|
+
## Nodes
|
|
38
|
+
### Vision
|
|
39
|
+
- **Annotate Results** — Draw estimator results (boxes / masks / poses) onto a frame
|
|
40
|
+
- **Frame Event** — Triggered when a camera frame is ready; exposes colour/depth/infrared streams
|
|
41
|
+
- **Frame Info Display** — Displays information about frames with live preview
|
|
42
|
+
- **OAK-D Camera** — Opens an OAK-D depth camera and emits colour/depth/infrared frame callbacks
|
|
43
|
+
- **Object Detector** — Detect objects in a frame (bounding box + class + score)
|
|
44
|
+
- **Pose Estimator** — Estimate human body pose (named joints + skeleton) per person
|
|
45
|
+
- **Segmentation** — Instance segmentation: detect objects and their pixel masks
|
|
46
|
+
- **Tracker** — Assign stable tracking ids to detections across frames
|
|
47
|
+
- **Web Camera** — Starts a webcam stream and emits frame callbacks
|
|
48
|
+
|
|
49
|
+
## Types
|
|
50
|
+
- **Depth Frame** — Single-channel uint16 metric depth buffer (millimetres)
|
|
51
|
+
- **Detection Result** — Object detections: bounding box, class, score (and tracking id)
|
|
52
|
+
- **Gray Frame** — Single-channel uint8 luminance video frame (e.g. infrared)
|
|
53
|
+
- **Landmark Result** — Landmark detections: a detection plus a set of landmark points
|
|
54
|
+
- **Multiframe Callback** — Subscription for multi-frame streams
|
|
55
|
+
- **Pose Result** — Human pose: landmarks with named joints and skeleton connections
|
|
56
|
+
- **RGB Frame** — 3-channel uint8 colour video frame
|
|
57
|
+
- **Segmentation Result** — Instance segmentation: detection plus a per-instance mask
|
|
58
|
+
- **Vision Result** — A list of estimator results (base type for all result kinds)
|
|
59
|
+
|
|
60
|
+
## Widgets
|
|
61
|
+
- **NumpyViewerWidget** — Streaming video viewer for numpy arrays using custom StreamingViewer
|
|
62
|
+
|
|
63
|
+
## Adapters
|
|
64
|
+
- **GrayToRgbAdapter** — Replicate a single-channel grey frame to a 3-channel colour frame
|
|
65
|
+
- **RgbToGrayAdapter** — Convert a 3-channel colour frame to a single-channel grey frame (luminance)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Visiongraph
|
|
2
|
+
|
|
3
|
+
<!-- marketstall:share-url:start -->
|
|
4
|
+
```sh
|
|
5
|
+
# Released packages (recommended):
|
|
6
|
+
https://going-haywire.github.io/haybale-visiongraph/marketplace.toml
|
|
7
|
+
|
|
8
|
+
# Always the latest (tracks the current branch):
|
|
9
|
+
https://github.com/going-haywire/haybale-visiongraph/blob/master/marketstall.toml
|
|
10
|
+
|
|
11
|
+
# Frozen to this version:
|
|
12
|
+
https://github.com/going-haywire/haybale-visiongraph/blob/v0.0.26/marketstall.toml
|
|
13
|
+
```
|
|
14
|
+
<!-- marketstall:share-url:end -->
|
|
15
|
+
|
|
16
|
+
Visiongraph library
|
|
17
|
+
|
|
18
|
+
## Nodes
|
|
19
|
+
### Vision
|
|
20
|
+
- **Annotate Results** — Draw estimator results (boxes / masks / poses) onto a frame
|
|
21
|
+
- **Frame Event** — Triggered when a camera frame is ready; exposes colour/depth/infrared streams
|
|
22
|
+
- **Frame Info Display** — Displays information about frames with live preview
|
|
23
|
+
- **OAK-D Camera** — Opens an OAK-D depth camera and emits colour/depth/infrared frame callbacks
|
|
24
|
+
- **Object Detector** — Detect objects in a frame (bounding box + class + score)
|
|
25
|
+
- **Pose Estimator** — Estimate human body pose (named joints + skeleton) per person
|
|
26
|
+
- **Segmentation** — Instance segmentation: detect objects and their pixel masks
|
|
27
|
+
- **Tracker** — Assign stable tracking ids to detections across frames
|
|
28
|
+
- **Web Camera** — Starts a webcam stream and emits frame callbacks
|
|
29
|
+
|
|
30
|
+
## Types
|
|
31
|
+
- **Depth Frame** — Single-channel uint16 metric depth buffer (millimetres)
|
|
32
|
+
- **Detection Result** — Object detections: bounding box, class, score (and tracking id)
|
|
33
|
+
- **Gray Frame** — Single-channel uint8 luminance video frame (e.g. infrared)
|
|
34
|
+
- **Landmark Result** — Landmark detections: a detection plus a set of landmark points
|
|
35
|
+
- **Multiframe Callback** — Subscription for multi-frame streams
|
|
36
|
+
- **Pose Result** — Human pose: landmarks with named joints and skeleton connections
|
|
37
|
+
- **RGB Frame** — 3-channel uint8 colour video frame
|
|
38
|
+
- **Segmentation Result** — Instance segmentation: detection plus a per-instance mask
|
|
39
|
+
- **Vision Result** — A list of estimator results (base type for all result kinds)
|
|
40
|
+
|
|
41
|
+
## Widgets
|
|
42
|
+
- **NumpyViewerWidget** — Streaming video viewer for numpy arrays using custom StreamingViewer
|
|
43
|
+
|
|
44
|
+
## Adapters
|
|
45
|
+
- **GrayToRgbAdapter** — Replicate a single-channel grey frame to a 3-channel colour frame
|
|
46
|
+
- **RgbToGrayAdapter** — Convert a 3-channel colour frame to a single-channel grey frame (luminance)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Visiongraph
|
|
2
|
+
|
|
3
|
+
Visiongraph library
|
|
4
|
+
|
|
5
|
+
## Nodes
|
|
6
|
+
### Vision
|
|
7
|
+
- **Annotate Results** — Draw estimator results (boxes / masks / poses) onto a frame
|
|
8
|
+
- **Frame Event** — Triggered when a camera frame is ready; exposes colour/depth/infrared streams
|
|
9
|
+
- **Frame Info Display** — Displays information about frames with live preview
|
|
10
|
+
- **OAK-D Camera** — Opens an OAK-D depth camera and emits colour/depth/infrared frame callbacks
|
|
11
|
+
- **Object Detector** — Detect objects in a frame (bounding box + class + score)
|
|
12
|
+
- **Pose Estimator** — Estimate human body pose (named joints + skeleton) per person
|
|
13
|
+
- **Segmentation** — Instance segmentation: detect objects and their pixel masks
|
|
14
|
+
- **Tracker** — Assign stable tracking ids to detections across frames
|
|
15
|
+
- **Web Camera** — Starts a webcam stream and emits frame callbacks
|
|
16
|
+
|
|
17
|
+
## Types
|
|
18
|
+
- **Depth Frame** — Single-channel uint16 metric depth buffer (millimetres)
|
|
19
|
+
- **Detection Result** — Object detections: bounding box, class, score (and tracking id)
|
|
20
|
+
- **Gray Frame** — Single-channel uint8 luminance video frame (e.g. infrared)
|
|
21
|
+
- **Landmark Result** — Landmark detections: a detection plus a set of landmark points
|
|
22
|
+
- **Multiframe Callback** — Subscription for multi-frame streams
|
|
23
|
+
- **Pose Result** — Human pose: landmarks with named joints and skeleton connections
|
|
24
|
+
- **RGB Frame** — 3-channel uint8 colour video frame
|
|
25
|
+
- **Segmentation Result** — Instance segmentation: detection plus a per-instance mask
|
|
26
|
+
- **Vision Result** — A list of estimator results (base type for all result kinds)
|
|
27
|
+
|
|
28
|
+
## Widgets
|
|
29
|
+
- **NumpyViewerWidget** — Streaming video viewer for numpy arrays using custom StreamingViewer
|
|
30
|
+
|
|
31
|
+
## Adapters
|
|
32
|
+
- **GrayToRgbAdapter** — Replicate a single-channel grey frame to a 3-channel colour frame
|
|
33
|
+
- **RgbToGrayAdapter** — Convert a 3-channel colour frame to a single-channel grey frame (luminance)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# visiongraph — component index (v0.0.26)
|
|
2
|
+
|
|
3
|
+
## node
|
|
4
|
+
- `visiongraph:node:AnnotateNode` — Annotate Results — Draw estimator results (boxes / masks / poses) onto a frame _tags: annotate, draw, overlay, render, result, visualize_
|
|
5
|
+
- `visiongraph:node:FrameDisplayNode` — Frame Info Display — Displays information about frames with live preview _tags: rgb, ir, frame, camera, display, preview, video, stream_
|
|
6
|
+
- `visiongraph:node:NumpyFrameEventNode` — Frame Event — Triggered when a camera frame is ready; exposes colour/depth/infrared streams _tags: 3d, depth, camera, oak, kinect, realsense, frame, event, rgb, ir, image_
|
|
7
|
+
- `visiongraph:node:OakDCameraNode` — OAK-D Camera — Opens an OAK-D depth camera and emits colour/depth/infrared frame callbacks _tags: oak, oak-d, depthai, luxonis, depth, camera, 3d, stream_
|
|
8
|
+
- `visiongraph:node:ObjectDetectorNode` — Object Detector — Detect objects in a frame (bounding box + class + score) _tags: object, detection, detector, yolo, deim, ssd, bbox, coco_
|
|
9
|
+
- `visiongraph:node:PoseEstimatorNode` — Pose Estimator — Estimate human body pose (named joints + skeleton) per person _tags: pose, human, body, skeleton, joints, landmark, mediapipe, movenet_
|
|
10
|
+
- `visiongraph:node:SegmentationNode` — Segmentation — Instance segmentation: detect objects and their pixel masks _tags: segmentation, instance, mask, yolo, maskrcnn, yolact_
|
|
11
|
+
- `visiongraph:node:TrackerNode` — Tracker — Assign stable tracking ids to detections across frames _tags: tracker, tracking, track, centroid, flate, motpy, id_
|
|
12
|
+
- `visiongraph:node:WebCameraNode` — Web Camera — Starts a webcam stream and emits frame callbacks _tags: webcam, camera, video, capture, stream_
|
|
13
|
+
|
|
14
|
+
## type
|
|
15
|
+
- `visiongraph:type:DEPTH_FRAME` — Depth Frame — Single-channel uint16 metric depth buffer (millimetres)
|
|
16
|
+
- `visiongraph:type:DETECTION_RESULT` — Detection Result — Object detections: bounding box, class, score (and tracking id)
|
|
17
|
+
- `visiongraph:type:GRAY_FRAME` — Gray Frame — Single-channel uint8 luminance video frame (e.g. infrared)
|
|
18
|
+
- `visiongraph:type:LANDMARK_RESULT` — Landmark Result — Landmark detections: a detection plus a set of landmark points
|
|
19
|
+
- `visiongraph:type:MULTIFRAME_CALLBACK` — Multiframe Callback — Subscription for multi-frame streams
|
|
20
|
+
- `visiongraph:type:POSE_RESULT` — Pose Result — Human pose: landmarks with named joints and skeleton connections
|
|
21
|
+
- `visiongraph:type:RGB_FRAME` — RGB Frame — 3-channel uint8 colour video frame
|
|
22
|
+
- `visiongraph:type:SEGMENTATION_RESULT` — Segmentation Result — Instance segmentation: detection plus a per-instance mask
|
|
23
|
+
- `visiongraph:type:VISION_RESULT` — Vision Result — A list of estimator results (base type for all result kinds)
|
|
24
|
+
|
|
25
|
+
## adapter
|
|
26
|
+
- `visiongraph:adapter:GrayToRgbAdapter` — GrayToRgbAdapter — Replicate a single-channel grey frame to a 3-channel colour frame
|
|
27
|
+
- `visiongraph:adapter:RgbToGrayAdapter` — RgbToGrayAdapter — Convert a 3-channel colour frame to a single-channel grey frame (luminance)
|
|
28
|
+
|
|
29
|
+
## widget
|
|
30
|
+
- `visiongraph:widget:NumpyViewerWidget` — NumpyViewerWidget — Streaming video viewer for numpy arrays using custom StreamingViewer
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Visiongraph Library for Haywire
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from importlib.metadata import version as _pkg_version
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from haywire.core.library.base import BaseLibrary
|
|
9
|
+
from haywire.core.library.compatibility import CompatibilityWarning
|
|
10
|
+
from haywire.core.library.decorator import library
|
|
11
|
+
from haywire.core.adapter.registry import AdapterRegistry
|
|
12
|
+
from haywire.core.node.registry import NodeRegistry
|
|
13
|
+
from haywire.core.types.registry import TypeRegistry
|
|
14
|
+
|
|
15
|
+
from haywire.ui.skin.registry import SkinRegistry
|
|
16
|
+
from haywire.ui.widget.registry import WidgetRegistry
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@library(
|
|
20
|
+
label="Visiongraph",
|
|
21
|
+
id="visiongraph",
|
|
22
|
+
version=_pkg_version("haybale-visiongraph"),
|
|
23
|
+
description="Visiongraph library",
|
|
24
|
+
url="https://github.com/haywire/haywire-repo/libraries/haybale-visiongraph",
|
|
25
|
+
help_url="https://docs.github.io/haywire_library",
|
|
26
|
+
author="Florian Briggisser, Martin Fröhlich",
|
|
27
|
+
author_url="https://author_url",
|
|
28
|
+
dependencies=['haybale_core'],
|
|
29
|
+
tags=['vision', 'camera', 'video', 'opencv'],
|
|
30
|
+
needs_refresh=True,
|
|
31
|
+
file_watcher=False,
|
|
32
|
+
)
|
|
33
|
+
class Library(BaseLibrary):
|
|
34
|
+
"""Example library implementation"""
|
|
35
|
+
|
|
36
|
+
def register_components(self):
|
|
37
|
+
"""Register all test components with the global registries"""
|
|
38
|
+
|
|
39
|
+
"""Register nodes and types"""
|
|
40
|
+
base_path = Path(__file__).parent
|
|
41
|
+
|
|
42
|
+
# Register types (both variants and custom types)
|
|
43
|
+
self.add_folder_to_registry(folder_path=str(base_path / "types"), registry_cls=TypeRegistry)
|
|
44
|
+
|
|
45
|
+
# Register adapters
|
|
46
|
+
self.add_folder_to_registry(folder_path=str(base_path / "adapters"), registry_cls=AdapterRegistry)
|
|
47
|
+
|
|
48
|
+
# Register widgets
|
|
49
|
+
self.add_folder_to_registry(folder_path=str(base_path / "widgets"), registry_cls=WidgetRegistry)
|
|
50
|
+
|
|
51
|
+
# Register skins (node skins)
|
|
52
|
+
self.add_folder_to_registry(folder_path=str(base_path / "skins"), registry_cls=SkinRegistry)
|
|
53
|
+
|
|
54
|
+
# Register nodes
|
|
55
|
+
self.add_folder_to_registry(folder_path=str(base_path / "nodes"), registry_cls=NodeRegistry)
|
|
56
|
+
|
|
57
|
+
def validate(self) -> bool:
|
|
58
|
+
"""Validate that the test library is properly structured"""
|
|
59
|
+
return True
|
|
60
|
+
|
|
61
|
+
def compatibility_warnings(self) -> list[CompatibilityWarning]:
|
|
62
|
+
"""Append-only history of compatibility notices. See ADR 0005."""
|
|
63
|
+
from .nodes import FrameDisplayNode
|
|
64
|
+
|
|
65
|
+
return [
|
|
66
|
+
CompatibilityWarning(
|
|
67
|
+
version="0.0.13",
|
|
68
|
+
component=FrameDisplayNode,
|
|
69
|
+
message=(
|
|
70
|
+
"The 'frame' inlet's widget visibility (show_widget) is now "
|
|
71
|
+
"author-declared (WHEN_LINKED). Graphs saved before 0.0.13 may "
|
|
72
|
+
"not show the live preview widget even when the inlet is linked. "
|
|
73
|
+
"Reset the node to re-derive it from current code."
|
|
74
|
+
),
|
|
75
|
+
),
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# Export for entry point discovery
|
|
80
|
+
__all__ = ["Library"]
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Frame adapters — conversions among the *image* frame types only.
|
|
3
|
+
|
|
4
|
+
`GRAY_FRAME <-> RGB_FRAME` are registered because they are always safe to apply
|
|
5
|
+
invisibly (channel replicate / luminance). **No adapter touches `DEPTH_FRAME`**:
|
|
6
|
+
depth colourization is lossy, parameterized, and display-only, so it must be a
|
|
7
|
+
deliberate node, never an auto edge-time coercion (see notes.md Q5).
|
|
8
|
+
|
|
9
|
+
Adapters operate on **unwrapped values** — here, ``BaseFrame`` instances.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import numpy as np
|
|
13
|
+
from typing_extensions import override
|
|
14
|
+
|
|
15
|
+
from haywire.core.adapter.base import BaseAdapter, adapter
|
|
16
|
+
|
|
17
|
+
from ..types.frame_type import GRAY_FRAME, RGB_FRAME
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@adapter(
|
|
21
|
+
description="Replicate a single-channel grey frame to a 3-channel colour frame",
|
|
22
|
+
converts_from=GRAY_FRAME,
|
|
23
|
+
converts_to=RGB_FRAME,
|
|
24
|
+
)
|
|
25
|
+
class GrayToRgbAdapter(BaseAdapter):
|
|
26
|
+
"""GRAY_FRAME -> RGB_FRAME by replicating the single channel across BGR."""
|
|
27
|
+
|
|
28
|
+
@override
|
|
29
|
+
def convert(self, value: GRAY_FRAME) -> RGB_FRAME:
|
|
30
|
+
rgb = value.data
|
|
31
|
+
if rgb is not None and rgb.ndim == 2:
|
|
32
|
+
rgb = np.stack([rgb, rgb, rgb], axis=-1)
|
|
33
|
+
return RGB_FRAME(data=rgb, timestamp=value.timestamp, frame_number=value.frame_number)
|
|
34
|
+
|
|
35
|
+
def get_test_value(self) -> GRAY_FRAME:
|
|
36
|
+
return GRAY_FRAME(data=np.zeros((4, 4), dtype=np.uint8))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@adapter(
|
|
40
|
+
description="Convert a 3-channel colour frame to a single-channel grey frame (luminance)",
|
|
41
|
+
converts_from=RGB_FRAME,
|
|
42
|
+
converts_to=GRAY_FRAME,
|
|
43
|
+
)
|
|
44
|
+
class RgbToGrayAdapter(BaseAdapter):
|
|
45
|
+
"""RGB_FRAME -> GRAY_FRAME via luminance."""
|
|
46
|
+
|
|
47
|
+
@override
|
|
48
|
+
def convert(self, value: RGB_FRAME) -> GRAY_FRAME:
|
|
49
|
+
gray = value.data
|
|
50
|
+
if gray is not None and gray.ndim == 3:
|
|
51
|
+
# Rec. 601 luma weights over BGR (OpenCV channel order).
|
|
52
|
+
gray = (gray[..., 0] * 0.114 + gray[..., 1] * 0.587 + gray[..., 2] * 0.299).astype(np.uint8)
|
|
53
|
+
return GRAY_FRAME(data=gray, timestamp=value.timestamp, frame_number=value.frame_number)
|
|
54
|
+
|
|
55
|
+
def get_test_value(self) -> RGB_FRAME:
|
|
56
|
+
return RGB_FRAME(data=np.zeros((4, 4, 3), dtype=np.uint8))
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# GrayToRgbAdapter
|
|
2
|
+
|
|
3
|
+
`visiongraph:adapter:GrayToRgbAdapter` · kind: adapter
|
|
4
|
+
|
|
5
|
+
Replicate a single-channel grey frame to a 3-channel colour frame
|
|
6
|
+
|
|
7
|
+
## Details
|
|
8
|
+
|
|
9
|
+
- **converts_from**: `visiongraph:type:GRAY_FRAME`
|
|
10
|
+
- **converts_to**: `visiongraph:type:RGB_FRAME`
|
|
11
|
+
- **priority**: `0`
|
|
12
|
+
|
|
13
|
+
## Notes
|
|
14
|
+
|
|
15
|
+
GRAY_FRAME -> RGB_FRAME by replicating the single channel across BGR.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# RgbToGrayAdapter
|
|
2
|
+
|
|
3
|
+
`visiongraph:adapter:RgbToGrayAdapter` · kind: adapter
|
|
4
|
+
|
|
5
|
+
Convert a 3-channel colour frame to a single-channel grey frame (luminance)
|
|
6
|
+
|
|
7
|
+
## Details
|
|
8
|
+
|
|
9
|
+
- **converts_from**: `visiongraph:type:RGB_FRAME`
|
|
10
|
+
- **converts_to**: `visiongraph:type:GRAY_FRAME`
|
|
11
|
+
- **priority**: `0`
|
|
12
|
+
|
|
13
|
+
## Notes
|
|
14
|
+
|
|
15
|
+
RGB_FRAME -> GRAY_FRAME via luminance.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Annotate Results
|
|
2
|
+
|
|
3
|
+
`visiongraph:node:AnnotateNode` · kind: node
|
|
4
|
+
|
|
5
|
+
Draw estimator results (boxes / masks / poses) onto a frame
|
|
6
|
+
|
|
7
|
+
## Ports
|
|
8
|
+
|
|
9
|
+
| id | direction | type | description |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| execute | inlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
12
|
+
| result | inlet | core:type:PooledType | Connect one or more estimator result outlets |
|
|
13
|
+
| frame | inlet | visiongraph:type:RGB_FRAME | 3-channel uint8 colour video frame |
|
|
14
|
+
| min_score | config | builtin:type:FLOAT | Decimal numberer |
|
|
15
|
+
| show_info | config | builtin:type:BOOL | True or False |
|
|
16
|
+
| frame_ready | outlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
17
|
+
| annotated | outlet | visiongraph:type:RGB_FRAME | 3-channel uint8 colour video frame |
|
|
18
|
+
|
|
19
|
+
## Settings
|
|
20
|
+
|
|
21
|
+
| name | bag | default | description |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| show_bounding_box | style | False | Draw the bounding box for landmark/pose results |
|
|
24
|
+
| marker_size | style | 3 | Landmark marker radius in pixels |
|
|
25
|
+
| stroke_width | style | 2 | Line width for boxes and skeleton connections |
|
|
26
|
+
|
|
27
|
+
## Notes
|
|
28
|
+
|
|
29
|
+
Overlay pooled vision results onto a frame.
|
|
30
|
+
|
|
31
|
+
Inputs:
|
|
32
|
+
execute: Control flow in.
|
|
33
|
+
result: Pooled result lists (any mix of VISION_RESULT subtypes).
|
|
34
|
+
frame: The image to draw on (RGB_FRAME).
|
|
35
|
+
min_score: Hide results / landmarks below this confidence.
|
|
36
|
+
show_info: Draw labels / info text.
|
|
37
|
+
|
|
38
|
+
Outputs:
|
|
39
|
+
frame_ready: Control flow out.
|
|
40
|
+
frame: The annotated frame (a copy; inputs are not mutated).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Frame Info Display
|
|
2
|
+
|
|
3
|
+
`visiongraph:node:FrameDisplayNode` · kind: node
|
|
4
|
+
|
|
5
|
+
Displays information about frames with live preview
|
|
6
|
+
|
|
7
|
+
## Ports
|
|
8
|
+
|
|
9
|
+
| id | direction | type | description |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| execute | inlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
12
|
+
| frame | inlet | visiongraph:type:RGB_FRAME | 3-channel uint8 colour video frame |
|
|
13
|
+
| info_display | config | builtin:type:STRING | Text data |
|
|
14
|
+
| frame_ready | outlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
15
|
+
| frame_pass | outlet | visiongraph:type:RGB_FRAME | 3-channel uint8 colour video frame |
|
|
16
|
+
| timestamp | outlet | builtin:type:FLOAT | Decimal numberer |
|
|
17
|
+
| frame_number | outlet | builtin:type:INT | Whole number |
|
|
18
|
+
| width | outlet | builtin:type:INT | Whole number |
|
|
19
|
+
| height | outlet | builtin:type:INT | Whole number |
|
|
20
|
+
|
|
21
|
+
## Notes
|
|
22
|
+
|
|
23
|
+
Displays frame information and live preview.
|
|
24
|
+
|
|
25
|
+
Shows frame metadata and streams the video to an embedded viewer.
|
|
26
|
+
|
|
27
|
+
Inputs:
|
|
28
|
+
execute: Control flow in
|
|
29
|
+
frame: Frame to display (RGB_FRAME type)
|
|
30
|
+
|
|
31
|
+
Outputs:
|
|
32
|
+
frame_ready: Control flow out
|
|
33
|
+
timestamp: Time since stream start
|
|
34
|
+
frame_number: Sequential frame number
|
|
35
|
+
width: Frame width
|
|
36
|
+
height: Frame height
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Frame Event
|
|
2
|
+
|
|
3
|
+
`visiongraph:node:NumpyFrameEventNode` · kind: node
|
|
4
|
+
|
|
5
|
+
Triggered when a camera frame is ready; exposes colour/depth/infrared streams
|
|
6
|
+
|
|
7
|
+
## Ports
|
|
8
|
+
|
|
9
|
+
| id | direction | type | description |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| enable_rgb | config | builtin:type:BOOL | True or False |
|
|
12
|
+
| enable_depth | config | builtin:type:BOOL | True or False |
|
|
13
|
+
| enable_ir | config | builtin:type:BOOL | True or False |
|
|
14
|
+
| subscription | outlet | visiongraph:type:MULTIFRAME_CALLBACK | Subscribe for camera frames |
|
|
15
|
+
| frame_ready | outlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
16
|
+
| timestamp | outlet | builtin:type:FLOAT | Decimal numberer |
|
|
17
|
+
| frame_number | outlet | builtin:type:INT | Whole number |
|
|
18
|
+
| rgb | outlet | visiongraph:type:RGB_FRAME | 3-channel uint8 colour video frame |
|
|
19
|
+
|
|
20
|
+
## Notes
|
|
21
|
+
|
|
22
|
+
Event node that receives 3D-camera frame callbacks.
|
|
23
|
+
|
|
24
|
+
Config:
|
|
25
|
+
rgb / depth / ir: Toggle which streams this node requests and exposes.
|
|
26
|
+
|
|
27
|
+
Outputs:
|
|
28
|
+
subscription: MULTIFRAME_CALLBACK carrying the event name + requirements.
|
|
29
|
+
frame_ready: Control flow when a frame arrives.
|
|
30
|
+
rgb / depth / ir: The requested frame streams (dynamic outlets).
|
|
31
|
+
frame_number / timestamp: Frame metadata.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# OAK-D Camera
|
|
2
|
+
|
|
3
|
+
`visiongraph:node:OakDCameraNode` · kind: node
|
|
4
|
+
|
|
5
|
+
Opens an OAK-D depth camera and emits colour/depth/infrared frame callbacks
|
|
6
|
+
|
|
7
|
+
## Ports
|
|
8
|
+
|
|
9
|
+
| id | direction | type | description |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| start | inlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
12
|
+
| stop | inlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
13
|
+
| callbacks | inlet | core:type:PooledType | Connect to a Frame Event node |
|
|
14
|
+
| status | config | builtin:type:STRING | Text data |
|
|
15
|
+
| visiongraph.node.OakDCameraNode.device.mxid | config | builtin:type:STRING | Leave empty to auto-select the first available OAK device. |
|
|
16
|
+
| started | outlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
17
|
+
| stopped | outlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
18
|
+
|
|
19
|
+
## Settings
|
|
20
|
+
|
|
21
|
+
| name | bag | default | description |
|
|
22
|
+
|---|---|---|---|
|
|
23
|
+
| mxid | device | '' | Leave empty to auto-select the first available OAK device. |
|
|
24
|
+
| want_rgb | stream_flags | False | Set by connected subscribers. Not user-editable. |
|
|
25
|
+
| want_depth | stream_flags | False | Set by connected subscribers. Not user-editable. |
|
|
26
|
+
| want_ir | stream_flags | False | Set by connected subscribers. Not user-editable. |
|
|
27
|
+
| enable_auto_exposure | color | True | Enables or disables auto exposure. Inert if Color is off. |
|
|
28
|
+
| exposure | color | 20000 | Manual exposure time. Only applied while Auto Exposure is off. Inert if Color is off. |
|
|
29
|
+
| iso | color | 800 | Sensor ISO sensitivity. Inert if Color is off. |
|
|
30
|
+
| auto_exposure_compensation | color | 0 | Bias applied to auto exposure, in the range [-9, 9]. Inert if Color is off. |
|
|
31
|
+
| enable_auto_white_balance | color | True | Enables or disables auto white balance. Inert if Color is off. |
|
|
32
|
+
| white_balance | color | 4000 | Manual white balance in Kelvin. Only applied while Auto White Balance is off. Inert if Color is off. |
|
|
33
|
+
| auto_white_balance_mode | color | 'AUTO' | Auto white balance scene preset (e.g. Daylight, Fluorescent). Inert if Color is off. |
|
|
34
|
+
| auto_focus | color | True | Enables or disables auto focus. Inert if Color is off. |
|
|
35
|
+
| focus_distance | color | 0 | Manual focus position. Only applied while Auto Focus is off. Inert if Color is off. |
|
|
36
|
+
| brightness | color | 0 | Image brightness, in the range [-10, 10]. Inert if Color is off. |
|
|
37
|
+
| contrast | color | 0 | Image contrast, in the range [-10, 10]. Inert if Color is off. |
|
|
38
|
+
| saturation | color | 0 | Image saturation, in the range [-10, 10]. Inert if Color is off. |
|
|
39
|
+
| sharpness | color | 0 | Image sharpness, in the range [0, 4]. Inert if Color is off. |
|
|
40
|
+
| luma_denoise | color | 0 | Luminance noise reduction, in the range [0, 4]. Inert if Color is off. |
|
|
41
|
+
| chroma_denoise | color | 0 | Chrominance (color) noise reduction, in the range [0, 4]. Inert if Color is off. |
|
|
42
|
+
| anti_banding_mode | color | 'AUTO' | Reduces flicker banding from artificial lighting. Inert if Color is off. |
|
|
43
|
+
| effect_mode | color | 'OFF' | Built-in color effect (e.g. Mono, Sepia, Negative). Inert if Color is off. |
|
|
44
|
+
| laser_intensity | ir | 0.0 | Sets intensity of laser dot projector |
|
|
45
|
+
| flood_intensity | ir | 0.0 | Sets intensity of the IR flood light |
|
|
46
|
+
| preset_mode | depth | 'HIGH_DENSITY' | Stereo depth quality/speed preset. Requires a device restart to apply. |
|
|
47
|
+
| median_filter | depth | 'KERNEL_7x7' | Disparity smoothing kernel. Requires a device restart to apply. |
|
|
48
|
+
| left_right_check | depth | True | Better handling of occlusions. Requires a device restart to apply. |
|
|
49
|
+
| subpixel | depth | False | Fractional disparity for longer-range accuracy. Restart required. |
|
|
50
|
+
| extended_disparity | depth | False | Closer-in minimum depth, doubled disparity range. Restart required. |
|
|
51
|
+
| frame_alignment | depth | 'Color' | Align the depth map to Color, Infrared, or leave Disabled. Restart required. |
|
|
52
|
+
|
|
53
|
+
## Notes
|
|
54
|
+
|
|
55
|
+
Starts an OAK-D capture stream in a separate thread and emits one callback
|
|
56
|
+
per frame carrying every active stream.
|
|
57
|
+
|
|
58
|
+
Inputs:
|
|
59
|
+
start: Open the device and begin capturing.
|
|
60
|
+
stop: Stop capturing and close the device.
|
|
61
|
+
callbacks: Pooled MULTIFRAME_CALLBACK subscriptions from event nodes.
|
|
62
|
+
|
|
63
|
+
Outputs:
|
|
64
|
+
started: Triggered when the device opens successfully.
|
|
65
|
+
stopped: Triggered when capture stops.
|
|
66
|
+
|
|
67
|
+
Settings:
|
|
68
|
+
device: Device MXID / name (empty = first available). Panel-only —
|
|
69
|
+
its dropdown resolves options via a live callable, which is only
|
|
70
|
+
safe on a setting() field (see `device.mxid` for why).
|
|
71
|
+
depth: Pipeline-construction params (read once at setup(), immutable
|
|
72
|
+
while running). Panel-only — not promotable to a port.
|
|
73
|
+
ir: Live IR laser/flood intensity. Promotable to an inlet — pushed
|
|
74
|
+
straight to the running device.
|
|
75
|
+
color: Live color-sensor controls (exposure/WB/focus/tuning).
|
|
76
|
+
Promotable to an inlet. Inert while enable_color is False (no
|
|
77
|
+
color control queue exists on the device in that case).
|
|
78
|
+
stream_flags: Read-only display of the requirement union gathered
|
|
79
|
+
from pooled subscribers (hb_gather_requirements). Not
|
|
80
|
+
user-editable, never promotable — set only via the callback edge.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Object Detector
|
|
2
|
+
|
|
3
|
+
`visiongraph:node:ObjectDetectorNode` · kind: node
|
|
4
|
+
|
|
5
|
+
Detect objects in a frame (bounding box + class + score)
|
|
6
|
+
|
|
7
|
+
## Ports
|
|
8
|
+
|
|
9
|
+
| id | direction | type | description |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| execute | inlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
12
|
+
| frame | inlet | visiongraph:type:RGB_FRAME | 3-channel uint8 colour video frame |
|
|
13
|
+
| model | config | builtin:type:STRING | Text data |
|
|
14
|
+
| min_score | config | builtin:type:FLOAT | Decimal numberer |
|
|
15
|
+
| status | config | builtin:type:STRING | Text data |
|
|
16
|
+
| result_ready | outlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
17
|
+
| result | outlet | visiongraph:type:DETECTION_RESULT | Object detections: bounding box, class, score (and tracking id) |
|
|
18
|
+
| count | outlet | builtin:type:INT | Whole number |
|
|
19
|
+
|
|
20
|
+
## Notes
|
|
21
|
+
|
|
22
|
+
Object detection family node — outlets ``DETECTION_RESULT``.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Pose Estimator
|
|
2
|
+
|
|
3
|
+
`visiongraph:node:PoseEstimatorNode` · kind: node
|
|
4
|
+
|
|
5
|
+
Estimate human body pose (named joints + skeleton) per person
|
|
6
|
+
|
|
7
|
+
## Ports
|
|
8
|
+
|
|
9
|
+
| id | direction | type | description |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| execute | inlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
12
|
+
| frame | inlet | visiongraph:type:RGB_FRAME | 3-channel uint8 colour video frame |
|
|
13
|
+
| model | config | builtin:type:STRING | Text data |
|
|
14
|
+
| min_score | config | builtin:type:FLOAT | Decimal numberer |
|
|
15
|
+
| status | config | builtin:type:STRING | Text data |
|
|
16
|
+
| result_ready | outlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
17
|
+
| result | outlet | visiongraph:type:POSE_RESULT | Human pose: landmarks with named joints and skeleton connections |
|
|
18
|
+
| count | outlet | builtin:type:INT | Whole number |
|
|
19
|
+
|
|
20
|
+
## Notes
|
|
21
|
+
|
|
22
|
+
Human-pose family node — outlets ``POSE_RESULT``.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Segmentation
|
|
2
|
+
|
|
3
|
+
`visiongraph:node:SegmentationNode` · kind: node
|
|
4
|
+
|
|
5
|
+
Instance segmentation: detect objects and their pixel masks
|
|
6
|
+
|
|
7
|
+
## Ports
|
|
8
|
+
|
|
9
|
+
| id | direction | type | description |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| execute | inlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
12
|
+
| frame | inlet | visiongraph:type:RGB_FRAME | 3-channel uint8 colour video frame |
|
|
13
|
+
| model | config | builtin:type:STRING | Text data |
|
|
14
|
+
| min_score | config | builtin:type:FLOAT | Decimal numberer |
|
|
15
|
+
| status | config | builtin:type:STRING | Text data |
|
|
16
|
+
| result_ready | outlet | core:type:EXEC | Signal for controlling execution flow between nodes |
|
|
17
|
+
| result | outlet | visiongraph:type:SEGMENTATION_RESULT | Instance segmentation: detection plus a per-instance mask |
|
|
18
|
+
| count | outlet | builtin:type:INT | Whole number |
|
|
19
|
+
|
|
20
|
+
## Notes
|
|
21
|
+
|
|
22
|
+
Instance-segmentation family node — outlets ``SEGMENTATION_RESULT``.
|