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.
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
# Two gates, neither of which needs a camera or a display: the dataflow still
|
|
# matches the typed contract in dora-node.yml, and the node's own tests pass.
|
|
name: validate
|
|
|
|
on: [push, pull_request]
|
|
|
|
env:
|
|
DORA_VERSION: v1.0.1
|
|
DORA_TARGET: x86_64-unknown-linux-gnu
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install the dora CLI
|
|
run: |
|
|
curl -fsSL -o dora-cli.tar.gz \
|
|
"https://github.com/dora-rs/dora/releases/download/${DORA_VERSION}/dora-cli-${DORA_TARGET}.tar.gz"
|
|
tar xzf dora-cli.tar.gz
|
|
mkdir -p "$HOME/.local/bin"
|
|
install -m 755 "dora-cli-${DORA_TARGET}/dora" "$HOME/.local/bin/dora"
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
rm -rf dora-cli.tar.gz "dora-cli-${DORA_TARGET}"
|
|
|
|
- run: dora --version
|
|
|
|
# strict_types: true in the dataflow turns a type warning into a non-zero
|
|
# exit, so a mismatched annotation fails here rather than at runtime.
|
|
- name: Validate the dataflow
|
|
run: dora validate dataflow.yml
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: astral-sh/setup-uv@v5
|
|
with:
|
|
enable-cache: true
|
|
|
|
# --locked fails if uv.lock is out of date with pyproject.toml, so a
|
|
# dependency change that was never locked cannot reach main.
|
|
- name: Install
|
|
run: uv sync --locked --group dev
|
|
|
|
- run: uv run ruff check .
|
|
|
|
# CI=true is already set by the runner, which is what keeps the node from
|
|
# trying to open a window on a headless machine.
|
|
- run: uv run pytest -q
|