A display sink that overlays bounding boxes and text on an image input and shows it in an OpenCV window. Based on opencv-plot from dora-hub, brought up to the dora 1.0 node contract and packaged with uv. Python rather than Rust: the opencv Rust crate generates its bindings from the OpenCV headers on the build machine, so it needs libopencv-dev and libclang-dev per machine and per architecture and does not cross-compile. Every dependency here ships prebuilt wheels for linux-x86_64, linux-aarch64 and macos-arm64. Covers every encoding the upstream node did — bgr8, rgb8, jpeg/jpg/jpe/bmp/ webp/png, yuv420 and avif — plus both bbox formats, the text overlay, PLOT_WIDTH/PLOT_HEIGHT and headless operation under CI=true.
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
# The repository's own example: a webcam and a fixed caption feeding the viewer.
|
|
# The plot node is built from this checkout with `path:` + `build:`, so
|
|
# `dora validate` picks up the typed contract in dora-node.yml next to it.
|
|
#
|
|
# Run it with `--uv` so every Python node gets its own managed environment.
|
|
# A consumer wires the node from a tag instead — see README.md.
|
|
#
|
|
# `bbox` is left unwired: every bbox source is a detector, and pulling one in
|
|
# would put a model download in the way of a webcam preview. README.md shows
|
|
# the wiring.
|
|
strict_types: true
|
|
|
|
nodes:
|
|
- id: camera
|
|
git: https://github.com/dora-rs/dora-hub.git
|
|
build: pip install ./node-hub/opencv-video-capture
|
|
path: opencv-video-capture
|
|
inputs:
|
|
tick: dora/timer/millis/100
|
|
outputs:
|
|
- image
|
|
output_types:
|
|
image: std/core/v1/UInt8
|
|
|
|
- id: caption
|
|
git: https://github.com/dora-rs/dora-hub.git
|
|
build: pip install ./node-hub/pyarrow-sender
|
|
path: pyarrow-sender
|
|
env:
|
|
DATA: "'dora-plot'"
|
|
outputs:
|
|
- data
|
|
output_types:
|
|
data: std/core/v1/String
|
|
|
|
- id: plot
|
|
path: opencv-plot
|
|
build: pip install .
|
|
inputs:
|
|
image: camera/image
|
|
text: caption/data
|