add opencv-plot node for dora dataflows
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.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
[project]
|
||||
name = "opencv-plot"
|
||||
version = "0.1.0"
|
||||
description = "Dora node that overlays bounding boxes and text on an image and displays it in an OpenCV window"
|
||||
readme = "README.md"
|
||||
license = { text = "MIT" }
|
||||
requires-python = ">=3.11"
|
||||
|
||||
# Every dependency ships prebuilt wheels for linux-x86_64, linux-aarch64 and
|
||||
# macos-arm64, so the node installs with no system packages and no compiler on
|
||||
# any of them. That is the whole reason this node is Python and not Rust: the
|
||||
# OpenCV Rust bindings generate themselves from installed headers and would put
|
||||
# libopencv-dev and libclang-dev on every build machine and every arch.
|
||||
dependencies = [
|
||||
"dora-rs >= 1.0.1",
|
||||
"numpy >= 2.0",
|
||||
"opencv-python >= 4.9",
|
||||
"pillow >= 10.4",
|
||||
"pillow-avif-plugin >= 1.4",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
opencv-plot = "opencv_plot.main:main"
|
||||
|
||||
[dependency-groups]
|
||||
dev = ["pytest >= 8.1", "ruff >= 0.9"]
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["opencv_plot"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
extend-select = ["D", "I", "N", "RET", "UP"]
|
||||
|
||||
[tool.ruff.lint.pydocstyle]
|
||||
convention = "pep257"
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
# Test names are the documentation here; a docstring would only repeat them.
|
||||
"tests/*" = ["D1"]
|
||||
Reference in New Issue
Block a user