Browse Source

Add `README` section for rerun within the dataflow

tags/v0.3.7rc0
haixuanTao 1 year ago
parent
commit
9133406c18
3 changed files with 84 additions and 0 deletions
  1. +27
    -0
      examples/camera/dataflow_rerun.yml
  2. +43
    -0
      examples/vlm/dataflow_rerun.yml
  3. +14
    -0
      node-hub/dora-rerun/src/main.rs

+ 27
- 0
examples/camera/dataflow_rerun.yml View File

@@ -0,0 +1,27 @@
nodes:
- id: camera
build: pip install ../../node-hub/opencv-video-capture
path: opencv-video-capture
inputs:
tick: dora/timer/millis/20
outputs:
- image
env:
CAPTURE_PATH: 0
IMAGE_WIDTH: 640
IMAGE_HEIGHT: 480

- id: plot
build: cargo build -p dora-rerun --release
path: dora-rerun
inputs:
image:
source: camera/image
queue_size: 1
env:
IMAGE_WIDTH: 640
IMAGE_HEIGHT: 480
README: |
# Visualization of your webcam

- You can increase or decrease the frequency within the dataflow with: `tick: dora/timer/millis/20` in the webcam node.

+ 43
- 0
examples/vlm/dataflow_rerun.yml View File

@@ -0,0 +1,43 @@
nodes:
- id: camera
build: pip install -e ../../node-hub/opencv-video-capture
path: opencv-video-capture
inputs:
tick: dora/timer/millis/20
outputs:
- image
env:
CAPTURE_PATH: 0
IMAGE_WIDTH: 640
IMAGE_HEIGHT: 480

- id: dora-qwenvl
build: pip install -e ../../node-hub/dora-qwenvl
path: dora-qwenvl
inputs:
image:
source: camera/image
queue_size: 1
tick: dora/timer/millis/200
outputs:
- text
- tick
env:
DEFAULT_QUESTION: Describe the image.

- id: plot
build: cargo build -p dora-rerun --release
path: dora-rerun
inputs:
image:
source: camera/image
queue_size: 1
text: dora-qwenvl/tick
env:
IMAGE_WIDTH: 640
IMAGE_HEIGHT: 480
README: |
# Visualization of your webcam

- You can increase or decrease the frequency within the dataflow with: `tick: dora/timer/millis/20` in the webcam node.
- You can change the model prompt within the dataflow with: `DEFAULT_QUESTION: Describe the image.`

+ 14
- 0
node-hub/dora-rerun/src/main.rs View File

@@ -43,6 +43,20 @@ fn main() -> Result<()> {
.spawn_opts(&options, None)
.context("Could not spawn rerun visualization")?;

match std::env::var("README") {
Ok(readme) => {
readme
.parse::<String>()
.context("Could not parse readme value")?;
rec.log("README", &rerun::TextDocument::new(readme))
.wrap_err("Could not log text")?;
}
Err(VarError::NotUnicode(_)) => {
return Err(eyre!("readme env variable is not unicode"));
}
Err(VarError::NotPresent) => (),
};

while let Some(event) = events.recv() {
if let Event::Input { id, data, metadata } = event {
if id.as_str().contains("image") {


Loading…
Cancel
Save