Skip to content

Examples and Results

This page is a lightweight notebook: run one cell, compare the typical output, then read what changed in the graph. Start here after install if you want a concrete path from a tiny Flow to visual perception and replay.

Command cell

pixi run demo-basic-flow

Typical output

============================================================
DoubleFlow - direct attribute access
  Input type: NumberInput
  Output type: NumberOutput
  [DoubleFlow] input.value=5 → result=10
  Result: NumberOutput(result=10)

============================================================
SignalAwareFlow - _signals pattern matching

  Case 1: Empty input (no signals)
  empty_input._signals = []
  [SignalAwareFlow] input._signals=[]
    No signals - skipping

  Case 2: Input with value
  full_input._signals = ['value']
  [SignalAwareFlow] input._signals=['value']
    value=7 → result=14
  Result: NumberOutput(result=14)
============================================================

What this teaches: a Flow is still ordinary Python: typed input, typed output, and a step(...) method. The _signals case shows how Retriever can distinguish “field missing” from “field present with a value” when composing pipelines.

Command cell

pixi run demo-stepper

Typical output

=== step 0 ===
[Sink] got value=2

=== step 1 ===
[Sink] got value=4

=== step 2 ===
[Sink] got value=6

=== step 3 ===
[Sink] got value=8

=== step 4 ===
[Sink] got value=10

What this teaches: before launching a backend, you can advance the same graph in-process. This is the fastest way to set breakpoints inside Flow.step(...), inspect local state, and reproduce a small failing case.

Command cell

pixi run demo-perception-stepper

Typical output

=== step 0 ===
[PrintDetections] frame=1 labels=['blue_object']

=== step 1 ===
[PrintDetections] frame=2 labels=['red_object']

=== step 2 ===
[PrintDetections] frame=3 labels=['blue_object']

What this teaches: the perception graph can be debugged with deterministic mock frames first. That keeps the first debugging loop independent of camera permissions, GUI windows, and backend scheduling.

Command cell: deterministic first smoke

pixi run demo-webcam-detection-mock

Command cell: live webcam and Rerun/stdout

pixi run demo-webcam-detection

Typical mock output

Perception Demo - Live or Mock Camera to Detection

Building perception pipeline:
  Camera @ Rate(20Hz) -> ColorDetector @ Trigger -> Display @ Rate

✓ Graph created: 3 nodes, 5 edges

Running for 0.1 seconds...
Tip: This run is using mock frames. Use --camera-mode real to require a live webcam path.
------------------------------------------------------------
  Frame 1: 2 objects - [('red_object', '0.95'), ('blue_object', '0.95')]
  Frame 2: 2 objects - [('red_object', '0.95'), ('blue_object', '0.95')]
  ...

Pipeline Summary

Camera Input:
  • Uses mock test pattern when mock mode is selected or auto fallback triggers

Detection:
  • Red objects: RGB(255, <100, <100)
  • Blue objects: RGB(<100, <100, 255)

What this teaches: the visual demo is still a small graph: camera, detector, display. Live mode shows the same structure with a real webcam and Rerun when available; mock mode gives a stable expected result for docs, tests, and remote machines.

Cell 5: render the graph before debugging timing

Section titled “Cell 5: render the graph before debugging timing”

Command cell

pixi run docs-tutorial-perception-html

Expected output

[Success] Visualization saved to: artifacts/tutorial_perception.html
Open this file in your browser to view the interactive graph.

What this teaches: the graph view is where timing becomes inspectable. Look for Flow nodes, ports, clocks, sync policies, and feedback edges before debugging backend behavior.

Command cell

pixi run demo-webcam-record
pixi run demo-webcam-replay-rrd

Expected result

logs/perception.rrd
logs/perception.mcap

What this teaches: a live robot or camera run can become a portable artifact. Replay lets you debug downstream logic without depending on the original sensor timing.