add an in-repo synthetic source so the example needs no network
validate / dataflow (pull_request) Failing after 59m9s
validate / test (pull_request) Successful in 59m8s

The example dataflow pulled opencv-video-capture and pyarrow-sender from
dora-hub, needed a webcam, and left `bbox` unwired because every bbox source
is a detector. examples/source.py emits an animated frame, the box around the
square in it, and a caption, so the dataflow exercises all three inputs with
nothing outside this checkout.

SOURCE_FRAMES bounds the run, which lets CI run the dataflow headless rather
than only validate it. Drops the dora-zed and dora-yolo wirings from the
README and trims AGENTS.md to what the code and README do not already say.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WLVZCFFcCH1EpTXGfS9aD
This commit is contained in:
2026-09-14 16:09:01 -05:00
co-authored by Claude Opus 5
parent e2debe0581
commit 22bd1e9e89
5 changed files with 151 additions and 89 deletions
+20 -28
View File
@@ -27,44 +27,35 @@ nodes:
Run the dataflow with `--uv` (`dora run dataflow.yml --uv`) so the node gets its own
managed environment.
Wire `image` from any node publishing one of the encodings below, and `bbox` from any
detector publishing the struct below. Both inputs are optional: an `image` alone is a
plain viewer.
### Runnable example
[`dataflow.yml`](dataflow.yml) wires a webcam and a fixed caption from dora-hub into
the viewer:
[`dataflow.yml`](dataflow.yml) is self-contained. [`examples/source.py`](examples/source.py)
is a synthetic source node that emits an animated frame, the box around the square
moving in it, and a caption — the three inputs this node draws — so the example needs
no camera, no detector and no network:
```bash
dora run dataflow.yml --uv
```
It builds the node from this checkout (`path:` + `build:`) rather than from a tag,
A window opens with a square bouncing across a gradient, boxed and labelled. Press `q`
to quit.
It builds both nodes from this checkout (`path:` + `build:`) rather than from a tag,
which is what lets `dora validate` pick up the manifest described below.
`bbox` is left unwired there, because every bbox source is a detector and pulling one
in would put a model download in front of a webcam preview. To see boxes, add
[`dora-yolo`](https://github.com/dora-rs/dora-hub/tree/main/node-hub/dora-yolo) between
the camera and the viewer:
Set `SOURCE_FRAMES` to stop the source after a fixed number of frames instead of running
until you quit; that plus `CI=true` is how the same dataflow runs headless as a test:
```yaml
- id: detector
git: https://github.com/dora-rs/dora-hub.git
build: pip install ./node-hub/dora-yolo
path: dora-yolo
inputs:
image: camera/image
outputs:
- bbox
- id: plot
path: dora-plot
build: pip install .
inputs:
image: camera/image
bbox: detector/bbox
```bash
CI=true SOURCE_FRAMES=30 dora run dataflow.yml --uv
```
To display a [dora-zed](https://gitea.liria.cl/liria/dora-zed) camera instead, wire
`image: zed-camera/image_bgr` — that node publishes `bgr8` with the `width`, `height`
and `encoding` metadata this one expects.
`SOURCE_WIDTH` and `SOURCE_HEIGHT` (default 640x480) set the frame size.
### Node manifest
@@ -160,5 +151,6 @@ display to show the window on (or `CI=true` to run without one).
uv run pytest
```
The tests cover decoding, the bbox format conversion and the headless draw path, so they
need neither a camera, a dataflow nor a display.
Unit tests over decoding, the bbox format conversion and the headless draw path; they
need neither a camera, a dataflow nor a display. The headless dataflow run above covers
the rest — the manifest, the wiring and the event loop.