Files
dora-image-view/examples/dora-node.yml
T
cristhian 0efeacd538 add a depth map panel
The node showed a colour image only, so debugging a depth pipeline meant
either trusting the numbers or writing a throwaway viewer. It now keeps one
panel per frame stream -- image and depth -- and tiles them side by side,
scaled to a common height. Wiring one is a plain viewer; wiring both shows
them together. bbox and text stay overlays rather than panels.

The contract follows what dora-zed already publishes: float32 [H, W] in
millimetres with 0 for missing. It is sent there as a raw byte slice, so the
payload arrives as UInt8 despite the Float32 contract and is reinterpreted
rather than converted.

Auto-ranging the colormap over the valid pixels' full extent, rather than over
a percentile of them, is deliberate and was not the first attempt: trimming
the tails collapsed on the scene the node exists for. A small object in front
of a large wall is a few percent of the pixels, so both tails landed on the
wall and the object clipped away. Rendering a frame and looking at it found
that; every test passed either way.

Verified with dora-cli 1.0.1: validate passes with both contracts injected,
the dataflow runs both nodes to a clean exit, and a composed frame was
rendered and inspected.
2026-09-15 05:06:50 -03:00

59 lines
1.9 KiB
YAML

# Manifest for the example source node.
#
# Its reason to exist is as much mechanical as documentary: `dora validate`
# matches a node manifest to a `path:` node by entrypoint, and without a
# manifest here the repository-root dora-node.yml -- whose entrypoint is
# `dora-image-view` -- gets tried against `examples/source.py`, does not match,
# and warns. Under `strict_types: true` that warning fails the run.
#
# Declaring the types here rather than as `output_types:` in dataflow.yml is
# what makes them checked: an inline annotation shadows the manifest, so the
# manifest would be injected but never compared against dora-image-view's.
apiVersion: 1
name: source
namespace: liria
description: Synthetic image, depth, bbox and text source for the dora-image-view example
categories: [debug]
keywords: [example, test, synthetic]
runtime: python
entrypoint: source.py
build: pip install .
dora: ">=1.0"
inputs:
tick:
required: true
description: Timer tick; one frame is emitted per tick.
outputs:
image:
type: std/core/v1/UInt8
description: >-
Animated bgr8 frame as a flat UInt8 buffer, with metadata
{width, height, encoding}.
bbox:
description: >-
The box around the moving square: an Arrow struct {bbox, conf, labels}
with metadata {format: xyxy}. Untyped to match the dora-image-view input.
text:
type: std/core/v1/String
description: A fixed caption.
depth:
type: std/core/v1/Float32
description: >-
Depth of the same scene in millimetres, [height, width]: a flat wall with
the square standing in front of it.
env:
SOURCE_WIDTH:
type: int
description: Frame width in pixels. Defaults to 640.
SOURCE_HEIGHT:
type: int
description: Frame height in pixels. Defaults to 480.
SOURCE_FRAMES:
type: int
description: Stop after this many frames. 0, the default, runs until the viewer quits.