Tube Builder Lab: per-tube stabilized crop window + comparison viz#81
Merged
Merged
Conversation
…bilized vs stabilized viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theTube(stabilization is a crop-window decision, not a tube-building step). No separate margin: the crop step supplies context viaCROP_CONTEXT.viz.crop_box_px— single source of truth for the crop region (expand byCROP_CONTEXT, square). Used by both the crop and the drawn box, so the box you see equals the crop you get.crop_tube_at_framenow routes through it and serves both per-frame boxes and union windows;draw_tube_windowsdraws 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_CONTEXTlowered to 1.6 (single shared knob, tightened by eye below the model's trainingcontext_factor ≈ 2.0).Scope: lab-only (approach A). Nothing in
bbox_tube_temporalchanges. Liftingtube_windowinto 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.mdTest Plan
make lint— cleanmake 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)