Skip to content

Tube Builder Lab: per-tube stabilized crop window + comparison viz#81

Merged
Chouffe merged 6 commits into
mainfrom
arthur/experiments-tube-builder-stable-bboxes
Jun 5, 2026
Merged

Tube Builder Lab: per-tube stabilized crop window + comparison viz#81
Chouffe merged 6 commits into
mainfrom
arthur/experiments-tube-builder-stable-bboxes

Conversation

@Chouffe

@Chouffe Chouffe commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds per-tube crop stabilization to the Tube Builder Lab so the temporal head can be shown a static crop window with the smoke moving inside it, instead of the current jumpy per-frame crop that recenters/rescales every frame.

  • stabilize.tube_window(tube) — pure function returning the union (enclosing) box of a built tube's observed detections, normalized. Does not mutate the Tube (stabilization is a crop-window decision, not a tube-building step). No separate margin: the crop step supplies context via CROP_CONTEXT.
  • viz.crop_box_px — single source of truth for the crop region (expand by CROP_CONTEXT, square). Used by both the crop and the drawn box, so the box you see equals the crop you get. crop_tube_at_frame now routes through it and serves both per-frame boxes and union windows; draw_tube_windows draws the same region in the tube colour.
  • app.py — removed the former (current) builder from the app (the candidate is now the only baseline); added a non-stabilized vs stabilized comparison: a two-up main viewer (left per-frame box, right fixed union window, tube-coloured, active-only) and a per-tube crops strip in the "candidate crops @ this frame" expander.
  • CROP_CONTEXT lowered to 1.6 (single shared knob, tightened by eye below the model's training context_factor ≈ 2.0).

Scope: lab-only (approach A). Nothing in bbox_tube_temporal changes. Lifting tube_window into the lib crop path (approach B) and retraining on the new crop distribution are out of scope — see the spec.

Spec: experiments/temporal-models/tube-builder-lab/docs/specs/2026-06-05-stable-tube-crop-window-design.md

Test Plan

  • make lint — clean
  • make test — 80 passed (tube_window: union/single/axis-independent/gaps/empty-raises; crop_box_px: square+context-scaled+centred, edge clamping; existing regression snapshots still pass)
  • make app — visually confirm the stabilized window stays fixed while the per-frame box moves, on a growing-plume target (e.g. platform_43096)

@Chouffe Chouffe merged commit 427dd4d into main Jun 5, 2026
21 checks passed
@Chouffe Chouffe deleted the arthur/experiments-tube-builder-stable-bboxes branch June 5, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant