Quality & Annotation (knonik viz)

knonik viz is a local web dashboard for the episode datasets knonik ingest produces. You launch it from the terminal and work in your browser. It lets you visualize, quality-check, annotate and compare episodes before you pack them for training.


1. What You Can Do

knonik viz works on ingested episode datasets: the per-episode directories knonik ingest writes (each with metadata.json, its streams and an annotations/ folder), not the packed KHLP dataset. Point the dashboard at such a directory, then:

  • ▸Visualize - play episode video, scrub a frame-accurate timeline, and plot numeric streams (state, action, qpos, …) and trajectories.
  • ▸Quality check (paid) - automatically score every episode of a teleoperated robot dataset against data-quality checks, and sort and filter by the flags.
  • ▸Annotate by hand - mark sub-step segments, write language descriptions, and accept object masks.
  • ▸Compare - overlay trajectories across episodes, and open several datasets side by side.

What Knonik Standard includes:

FeatureAvailability
Visualization and comparisonfree
Manual annotationfree
Automatic quality check, teleoperated robot dataPro plan; spends credits per episode checked
Auto-annotation (segmentation and language labels)not yet available - coming later
Quality check for egocentric (human video) datacoming with Knonik Hub

Accepted annotations and quality results are stored with the episodes, so a later knonik pack carries them into the dataset your training job loads.


2. Install

knonik viz ships in the Knonik wheel. See Overview → Install. Verify:

bash
knonik viz --help

3. Log In

Log in once for the dashboard with your email and a CLI key from your dashboard (see Overview → Log In):

bash
knonik login --product processing

On headless Linux machines without an OS keyring, add --allow-file-key-store. Check or clear the session with knonik status --product processing and knonik logout --product processing.


4. Launch The Dashboard

bash
knonik viz                      # serves on http://127.0.0.1:3000 and opens a browser
knonik viz --port 8080          # choose a different port
knonik viz --no-browser         # print the URL instead of opening a browser

Working over SSH (remote box)

The dashboard listens on the loopback interface only, so forward the port from your laptop:

bash
ssh -L 3000:127.0.0.1:3000 user@remote-box
# on the remote box:
knonik viz --no-browser
# then open the printed http://127.0.0.1:3000/#knonik-bootstrap=... URL in your local browser

5. Open A Dataset (Create A Session)

In the dashboard you create a session by pointing it at a dataset root: the directory that directly contains the episode_000000/, episode_000001/, … folders from knonik ingest.

text
knonik_thread_velcro/            ← point the session here (dataset root)
├── config.json                  ← dataset config, written by ingest (see §6)
├── episode_000000/
│   ├── metadata.json
│   ├── rgb_*.webm
│   ├── <numeric_stream>/        (zarr arrays)
│   └── annotations/             (segments / language / objects written here)
├── episode_000001/
└── …

Notes:

  • ▸You can open several sessions at once (one per dataset) to compare them.
  • ▸Closing a session only detaches the dashboard; it never deletes your data.
  • ▸For quality check, the dataset root must contain a completed config.json; see section 6.

6. Dataset Config

The dataset config is a config.json at the dataset root that describes the ingested episodes: which streams exist, which one is the action and which the state, and which channels belong to each arm. Quality check needs it; visualization uses it for labels and per-arm plots.

It is not the ingest config, which describes your raw data.

6.1 Generate It and Fill In the Blanks

knonik ingest writes config.json for you at the end of every run. It fills in everything it can read from the data (stream names, widths, frame rates, channel names where the source declares them) and leaves the rest as <FILL:...> values:

json
"numeric_correspondance": {
  "action": "<FILL:stream_name>",
  "qpos": "<FILL:stream_name|omit>"
},
"action_values": { "type": "<FILL:absolute|delta>" },
"arms": {
  "<FILL:arm_name>": {
    "indices": "<FILL:[start,end]>",
    "gripper_dim": "<FILL:index_within_slice|omit>"
  }
},
"arm_names": ["<FILL:arm_name>"]

Edit the values in place. Then:

bash
knonik config check   /data/my_dataset    # lists what is still missing, with a question for each
knonik config resolve /data/my_dataset    # fills in values that follow from your answers (e.g. dof_names)
knonik config resolve /data/my_dataset --with-dimensions   # also adds a numeric_dimensions block to fill

Quality check refuses to run while any <FILL:...> value remains. The _needs_input and _generated blocks in the file are notes for you; you can delete them when you are done.

Other cases:

  • ▸Dataset ingested before configs existed: knonik config init /data/my_dataset.
  • ▸Regenerate an existing config: an existing config.json is never overwritten; pass --force-config to knonik ingest or knonik config init.

6.2 Fields

Required

FieldMeaning
dataset_rootThe directory holding episode_*.
streamsStream names by type: numeric.names, rgb.names + rgb.fps, depth.names ([] if none). Names must match the episode files exactly.
numeric_correspondanceaction: the commanded stream (required). qpos: the measured state stream (optional; without it the _motion checks are skipped).
armsOne entry per arm: indices and optionally gripper_dim, dof_names, action_bounds.
arm_namesThe arms, in order. Results are reported per arm.

Arm fields

KeyMeaning
indices[start, end] channels of the numeric vector, inclusive. [0, 6] is seven channels.
gripper_dimThe gripper channel within the arm's slice (for [7, 13] with the gripper last, 6). Omit if the arm has no gripper channel.
dof_namesChannel labels for the plots, one per channel including the gripper.
action_boundsOptional [[low, …], [high, …]] for the arm's non-gripper channels.

Optional

FieldMeaning
action_values.typeabsolute (default; actions are targets) or delta (actions are increments).
numeric_dimensionsPer-channel name, kind (linear, angular, gripper, other), optional bounds [min, max] and period for angular channels. List every channel of the vector, keyed by action and/or state. Enables the saturation check and correct handling of angle wrap-around.
numeric_timestampsOnly if a stream's timestamps are not the <stream>_time array ingest writes: {"action": {"stream": "...", "semantics": "seconds" | "frame_index"}}.
agent_metaYour own labels (operator, site, robot), copied into the report.

Take bounds from your robot's joint limits, not from the recorded data.

6.3 Example

A 14-channel bimanual robot, seven channels per arm with the gripper last:

json
{
  "dataset_root": "/data/aloha_ingested",
  "streams": {
    "numeric": {"names": ["state", "action"]},
    "rgb": {"names": ["cam_high", "cam_left_wrist", "cam_right_wrist"], "fps": 50},
    "depth": {"names": []}
  },
  "numeric_correspondance": {"action": "action", "qpos": "state"},
  "action_values": {"type": "absolute"},
  "arms": {
    "left":  {"indices": [0, 6],  "gripper_dim": 6},
    "right": {"indices": [7, 13], "gripper_dim": 6}
  },
  "arm_names": ["left", "right"]
}

For a single arm, use one entry, e.g. "arms": {"arm": {"indices": [0, 6], "gripper_dim": 6}} and "arm_names": ["arm"].

6.4 ROS Bags

ROS ingest keeps one numeric stream per topic, so you choose the roles:

  • ▸action: the command topic (for example ..._controller_command).
  • ▸qpos: the measured topic, usually joint_states.

indices is applied to both streams, so the slice must mean the same joints in each. Command topics often carry fewer joints than joint_states, in a different order. After setting action and qpos, run knonik config resolve <dataset_root>: the arms entry in _needs_input then lists both streams' channels by name and the ranges where they line up. Then either:

  • ▸set indices to a range where both streams line up, or
  • ▸omit qpos and cover the whole command vector (only the command-side checks run).

If the gripper is published on its own topic, omit gripper_dim.

6.5 Config Warnings

A quality run lists config warnings alongside the flags. They mean a check was skipped because the config did not say enough:

CodeMeaningFix
700numeric_dimensions not declaredAdd the block.
701State stream unavailableCheck numeric_correspondance.qpos.
702No bounds; saturation skippedAdd bounds to every non-gripper channel, or action_bounds to the arm.
703 / 704Invalid action / state values (NaN, inf)Check the recording.
705Episode too short-
706Timestamps are frame indicesSet numeric_timestamps if that is not intended.
707 / 708Timestamps missing / invalidPoint numeric_timestamps.*.stream at the right array.
709Too little motion to measure smoothness-
710Angle wrap-around inferredDeclare kind: "angular" on rotational channels.

6.6 Common Mistakes

SymptomFix
Quality run is rejected before it startsRun knonik config check; it names what is missing.
Last channel of an arm is never checkedindices is inclusive: seven channels from 0 is [0, 6].
Gripper flags land on the wrong channelgripper_dim is relative to the arm's slice, not the whole vector.
Rate-based flags all look too strict or too loosestreams.rgb.fps does not match the real capture rate.
A stream is missing from the plotsIts name in streams does not match the episode's metadata.json.
Nothing is foundOpen the directory that directly contains episode_*, not its parent.

7. Visualize Episodes

Once a session is open, pick an episode to:

  • ▸Play the RGB video and scrub a frame-accurate timeline.
  • ▸Plot numeric streams - state, action, qpos/qvel and so on - over time.
  • ▸View trajectories for the episode.
  • ▸See segments overlaid on the timeline once the episode is annotated.
  • ▸See quality flags on the timeline once a quality run has finished.

Visualization reads straight from the episode directory and never modifies it.


8. Quality Check

The quality check scans each episode of a teleoperated robot dataset for common data problems and produces a report you can sort and filter, so you can drop or fix bad episodes before training.

Paid feature. Quality check needs the Pro plan and spends credits for every episode it checks. A run is refused up front if your balance cannot cover the episodes in it, so a run never stops halfway. Your balance and top-ups are on your dashboard; rates are on the pricing page. Every new account starts with free credits.

Teleoperated data only. The quality check reads the action and state streams of a robot arm (or several). Egocentric and video-only datasets have no such streams; quality checking for them is coming with Knonik Hub.

How to run it:

  1. ▸Make sure the dataset root contains a completed config.json (quality reads the stream layout and arm channels from it; the run is rejected while it is missing or still has <FILL:...> values). See section 6 and knonik config check <dataset_root>.
  2. ▸In the session, start a Quality run and choose a profile:
    • ▸conservative (default) - flags only clear problems.
    • ▸standard - balanced.
    • ▸strict - flags more aggressively.
  3. ▸Results appear per episode and per arm in the dashboard, and are written to quality_metrics.json (every episode), quality_flagged.json (just the flagged episodes) and quality_analysis.json (the dataset-level summary) in the dataset root.

Flags are suffixed _commands when they come from the action stream and _motion when they come from the measured state stream:

AreaFlags
Dead or frozen datadead_actions, mostly_static_commands / mostly_static_motion, long_static_run, sustained_hold, wait_time
Smoothnessjerky_commands / jerky_motion, abrupt_commands / abrupt_motion, control_noise_commands / control_noise_motion, stop_and_go_commands / stop_and_go_motion
Grippergripper_chatter
Limits and valuessaturated, invalid_commands / invalid_motion
Diversitylow_entropy / high_entropy
Episodeinsufficient_frames, aborted_episode
Timingirregular_timestamps / invalid_timestamps

Flags are signals for review, not automatic rejections. A flagged episode can be perfectly usable; look at it in the timeline before you drop it.

The report also carries the config-level warnings from section 6.5. Check those first if a flag you expected never appears: an underspecified config makes the quality check skip checks rather than fail.

Re-running quality overwrites these files.


9. Auto-Annotate

Not available yet. Auto-annotation (automatic temporal segmentation and generated language labels) is switched off in the current release and will be enabled later. The auto-annotate controls in the dashboard stay disabled until then. Use manual annotation (section 10) in the meantime; everything you annotate by hand stays valid when auto-annotation arrives.


10. Manually Annotate

The annotation editor lets you produce or correct annotations by hand:

  • ▸Edit segment boundaries - mark where each sub-step starts and ends on the timeline, add or remove segments.
  • ▸Write and edit language descriptions for episodes and segments.
  • ▸Select and accept objects - create object masks on a frame and accept the ones you want.
  • ▸Accept - accepted edits are committed to the episode's annotations/ folder. Drafts you do not accept are not saved.

11. Compare Episodes & Datasets

  • ▸Within a dataset - overlay trajectories across episodes to spot outliers or inconsistent demonstrations, and step through episodes in the same view.
  • ▸Across datasets - open one session per dataset root and switch between them, or view them side by side, to compare two captures, two robots, or the same data before and after processing.

Comparison is read-only.


12. Where Results Are Saved

  • ▸Annotations (segments, language, objects you accept) are written into each episode's annotations/ directory, next to its streams.
  • ▸Quality results are written to quality_metrics.json, quality_flagged.json and quality_analysis.json in the dataset root.

Because these live with the episodes, knonik pack carries them into the KHLP dataset your training job loads.


13. Security & Privacy

  • ▸The dashboard binds to 127.0.0.1 only and is never exposed to the network. Remote use goes through an SSH tunnel (section 4).
  • ▸Every request from the browser is checked against a one-time bootstrap secret (the #knonik-bootstrap=… part of the URL) plus your knonik login --product processing session, so other users and processes on the machine cannot drive your dashboard.
  • ▸Visualization, quality check and manual annotation run on your machine. Your episode video and streams are not uploaded. A quality run sends its result summary (per-episode scores and flags, and the dataset path) to your Knonik account; nothing else leaves the machine.

14. Troubleshooting

knonik viz exits or the page won't authorize

Open the exact URL printed by knonik viz, including the #knonik-bootstrap=… fragment. If you navigated to a plain http://127.0.0.1:3000, restart knonik viz and use the freshly printed URL (each launch creates a new secret).

processing_session_not_authorized / 401 in the dashboard

You are not logged in for the dashboard, or the session expired. Run knonik login --product processing and reload.

Quality run says quality_config_not_found

The dataset root has no config.json. Generate one with knonik config init <dataset_root>, fill in the <FILL:...> values, and re-run.

Quality run is rejected for missing values

The config still has <FILL:...> placeholders. knonik config check <dataset_root> lists each one with the question it needs answered.

Quality run says feature_not_enabled:quality_gate

Your plan does not include the quality check. Upgrade to Pro from your dashboard, then run knonik login --product processing again so the session picks up the change.

Quality run says you are out of credits / 402

Your credit balance cannot cover the episodes in the run. Buy credits from your dashboard, log in again, and re-run, or run on fewer episodes.

The auto-annotate controls are greyed out

Expected: auto-annotation is not enabled in the current release (section 9).

Can't reach the dashboard over SSH

Forward the port: ssh -L 3000:127.0.0.1:3000 user@host, run knonik viz --no-browser on the host, and open the printed loopback URL locally.

Port already in use

Pick another port: knonik viz --port 8080.