tools(pipeline): hybrid track.py + simulator label author mode #17

Merged
benstull merged 1 commits from feature/content-pipeline-track-author into main 2026-06-25 01:14:59 +00:00
Owner

Content-pipeline Increment 2, part 2 — the tooling (design §11.5). Builds on #16 (the experience).

tools/pipeline/track.py — hybrid motion-track pass

  • Classical path (always available): a hand-seeded normalized box propagated by OpenCV Lucas-Kanade optical flow (a CSRT tracker is used instead when a contrib build provides one), sampled to a sparse loop-normalized keyframed track + an appear/disappear window.
  • Optional ML path: detect_and_track lazy-imports ultralytics (clear ImportError if absent — the base install needs only opencv-python).
  • Geometry only — keys/strings/scientific names/facts are never produced here.
  • Pure helpers unit-tested; the cv2 propagation is an opt-in integration test on real abyss_wow footage.

Simulator author mode — /author.html

Reuses the preview stage: pick a pool clip, scrub, drag a seed box, Run tracker (or Add as static box), author the LEFT detail tiers (general → scientific+fact) + salience, shift-click to place affect anchors with RIGHT emotion tiers, and Save to manifest.

  • POST /api/author/track runs track_seed on the clip's base footage.
  • POST /api/author/clip does an idempotent upsert via tools/pipeline/manifest — keeps the clip's media + provenance, replaces only authored content, reloads in place (no restart).

Also

  • Repointed the pipeline integration test off the retired forest base to the cosmos pool primary.
  • docs/USER_GUIDE.md simulator section brought current (pools, coast, 3-knob Mood, real-time dream, progressive tiers, author mode).

Verification

  • 267 passed / 2 skipped (track pure helpers + opt-in real-footage track + author endpoint tests). JS syntax-checked; live server probed (/author.html, /api/author/track on real footage returns keyframes, committed manifest untouched).
  • Author UI by-eye review deferred to the operator (no Chrome on this box).

🤖 Generated with Claude Code

Content-pipeline **Increment 2, part 2 — the tooling** (design §11.5). Builds on #16 (the experience). ### `tools/pipeline/track.py` — hybrid motion-track pass - **Classical path** (always available): a hand-seeded normalized box propagated by OpenCV **Lucas-Kanade optical flow** (a CSRT tracker is used instead when a contrib build provides one), sampled to a **sparse** loop-normalized keyframed `track` + an `appear`/`disappear` window. - **Optional ML path**: `detect_and_track` lazy-imports `ultralytics` (clear ImportError if absent — the base install needs only `opencv-python`). - **Geometry only** — keys/strings/scientific names/facts are never produced here. - Pure helpers unit-tested; the cv2 propagation is an **opt-in** integration test on real `abyss_wow` footage. ### Simulator author mode — `/author.html` Reuses the preview stage: pick a pool clip, **scrub**, **drag a seed box**, **Run tracker** (or **Add as static box**), author the **LEFT detail tiers** (general → scientific+fact) + salience, **shift-click** to place **affect anchors** with **RIGHT emotion tiers**, and **Save to manifest**. - `POST /api/author/track` runs `track_seed` on the clip's base footage. - `POST /api/author/clip` does an idempotent upsert via `tools/pipeline/manifest` — keeps the clip's media + provenance, replaces only authored content, reloads in place (no restart). ### Also - Repointed the pipeline integration test off the retired `forest` base to the `cosmos` pool primary. - `docs/USER_GUIDE.md` simulator section brought current (pools, coast, 3-knob Mood, real-time dream, progressive tiers, author mode). ### Verification - **267 passed / 2 skipped** (track pure helpers + opt-in real-footage track + author endpoint tests). JS syntax-checked; live server probed (`/author.html`, `/api/author/track` on real footage returns keyframes, committed manifest untouched). - **Author UI by-eye review deferred to the operator** (no Chrome on this box). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
benstull added 1 commit 2026-06-25 01:14:51 +00:00
Content-pipeline Increment 2, part 2 (the tooling). Implements design §11.5
(docs/superpowers/specs/2026-06-24-content-pipeline-design.md):

- tools/pipeline/track.py — the stage-5 geometry pass. Classical path: a
  hand-seeded normalized box propagated by OpenCV Lucas-Kanade optical flow
  (CSRT used instead when a contrib build provides it), sampled to a SPARSE
  loop-normalized keyframed track + an appear/disappear window. Optional ML
  detect+track path lazy-imports ultralytics (clear ImportError if absent;
  base install needs only cv2). Pure helpers (normalize/denormalize, loop_t,
  infer_window, sample_track, track_to_annotation) are unit-tested; the cv2
  propagation is an opt-in integration test on real abyss_wow footage.
  Semantics are never produced here — geometry only.

- Author mode — /author.html + author.js/.css reuse the preview stage: pick a
  pool clip, scrub, drag a seed box, Run tracker (or Add as static box), author
  the LEFT detail tiers (general -> scientific+fact) + salience, shift-click to
  place affect anchors with RIGHT emotion tiers, and Save to manifest. Backend:
  POST /api/author/track (runs track_seed on the clip's base) + POST
  /api/author/clip (idempotent upsert via tools.pipeline.manifest — keeps media
  + provenance, replaces only authored content, reloads in place). The tracker
  propagates box geometry; all strings/scientific names/facts are hand-typed.

- Repointed the pipeline integration test off the retired forest base to the
  cosmos pool primary. USER_GUIDE simulator section brought current (pools,
  coast, 3-knob Mood, real-time dream, progressive tiers, author mode).

267 passed / 2 skipped (+ track pure + opt-in real-footage + author endpoint
tests). Author UI by-eye review deferred to the operator (no Chrome on this box).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benstull merged commit c4452396a1 into main 2026-06-25 01:14:59 +00:00
Sign in to join this conversation.