Skip to content

Keep printed faces out of auto layout and stop per-shot layout churn - #438

Merged
dillonstreator merged 3 commits into
mainfrom
claude/fix-printed-faces-layout-churn-60bb3c
Dec 2, 2026
Merged

dillonstreator merged 3 commits into
mainfrom
claude/fix-printed-faces-layout-churn-60bb3c

Conversation

@dillonstreator

@dillonstreator dillonstreator commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Problem

On a multi-camera podcast (Bad Friends Ep 348) the automatic layout had two faults:

  1. Faces printed on clothes counted as people. Both hosts and a guest wear "BADSGIVING" merch shirts printed with the hosts' faces. YuNet boxes the prints (0.08-0.16 of the frame tall, about 2 face heights under the wearer's face), so a host's close-up became a split whose second pane framed the shirt. A painted portrait on the wall (detector score ~0.6, box height wobbling ~1.5%) slipped past dropStaticFaces, so the guests' two-shot read as three people and was shown whole.
  2. Layout churn. The show cuts every 1-3 s between a host close-up, the guests' couch and a wide desk shot. Each shot got its own layout, so a 30 s clip came out as 13 pieces: fit 0-2, split 2-6, stack 6-11, fit 11-12, split 12-13, face 13-14, ….

Fix

  • liveFaces (layout.ts) drops faces that are not people before any layout rule reads the samples. The render, the evals, reelsaw faces and sample-shot all call it.

    • On clothes (onTorso): a box whose centre is 1-3 face heights below a bigger face, within 1.25 of that face's widths across, and at most 0.85 of its height. A face track that is on a torso in at least half of the frames it shares with a bigger face is dropped in every frame, including frames where the wearer's own face was missed. Active speaker detection drops prints per frame before matching faces to seats (withoutPrints), so a print is never taken for a seat or counted as a third person.
    • On the wall: dropStaticFaces now also drops a picture that is re-detected at the same spot after a cut (two or more face tracks) when YuNet's landmarks hold still inside its box (spread < 0.007 of the box), even though its box height wobbles under 3%. One track alone never qualifies: a speaker holding still for a second measured 0.006.
  • settleLayouts adds hysteresis across shots inside segmentLayouts. An inner shot under MIN_LAYOUT_SEC (2 s), or one under 3 s between two face crops, splits or stacks of the same layout, takes a neighbour's layout when that layout can show it:

    • the whole frame (fit) can show anything;
    • a face crop can show a two-shot (on its lead person) or a small-face stack;
    • a stack (whole frame over the face) can show a close-up or a two-shot.

    The shot is re-framed on its own faces (forcedDecision). A shot no neighbour can show keeps its layout (a close-up between two splits, a crowd between face crops). The clip's first and last pieces are left alone, since they may be longer shots cut by the clip's edges. Layout now changes at a cut between shots that last, within a shot only on a sustained change in the faces (the existing 2.5 s rule), and between talkers only on active speaker detection's turns.

Builds on #436 (merged); no changes to followTalker, shotSeats or the forced-face path.

Evals (pnpm eval framing speakers)

Three new framing shots cases from the episode, with new checks:

  • printed: no pane on a print or the painting;
  • maxSegmentsPerMin: segments per minute;
  • minSegmentSec: shortest inner segment.

shots-multicam-guest-two-shots is the regression check that a lasting two-shot (5 s, both guests) still splits.

case before (main) after
shots-multicam-printed-shirts (clip of the report) FAIL: agreement 0.48, 31.6 segments/min, shortest 1.0 s, 59% of crop points on a print pass: 1.00, 5.9/min, shortest 7.5 s, 0%
shots-multicam-guest-cutaways FAIL: 0.89, 19.0/min, 1.0 s, 8% pass: 1.00, 4.4/min, 18.9 s, 0%
shots-multicam-guest-two-shots (real split kept) FAIL: 0.52, 20.1/min, 1.0 s, 44% pass: 1.00, 9.0/min, 1.0 s (a 1 s photo insert of a crowd, shown whole), 0%
shots-couch-multicam pass: 12.1/min, shortest 1.54 s pass: 11.1/min, 1.77 s
shots-couch-multicam-guest-story FAIL 0.68 (known since YuNet) FAIL 0.68, 17.3 → 14.2/min. The 1.1 s hosts' two-shot between two crowd shots is now shown whole; the label accepts fit too

Framing summary: passRate 0.91 → 0.92, worstShotAgreement 0.684 → 0.684, worstPrintedTargets 0, worstSegmentsPerMin 14.2. No framing case regressed; eval/baselines/framing.json is updated.

Speakers: 8/9 pass both before and after. sistercircle-couch-smiling-listener fails on main on this machine too (talk 0/0 → split), so it is not caused by this change; that baseline is left as is.

Unit tests: test/live-faces-settle.test.ts (new). test/segment-shots.test.ts now expects a 1.1 s two-shot between close-ups to keep the close-ups' crop.

Trade-offs

  • A two-shot under 2 s (under 3 s between two close-ups) shows a face crop on its lead person, not on whoever talks. Active speaker detection only runs on splits of 3 s or more, so these short shots were never attributed anyway.
  • Torso detection is by position only. A smaller person directly under and in front of a bigger face (a child on a lap) would be dropped. A print whose wearer's face is out of frame is not caught. Both are listed in docs/LAYOUTS.md caveats.

Docs

docs/LAYOUTS.md (faces that are not people, hysteresis, caveats, eval coverage), docs/EVALS.md, docs/TROUBLESHOOTING.md, changeset.

Verified on

Offline: the eval suites and sample-shot on three ranges of the episode. Pieces before → after:

clip before after
6eac5e7d 13 3
ff22a1fc 12 3
4a78c313 22 in 60 s 9

Re-rendered four Bad Friends clips (Ep 348, 347, 344) on a local instance running this branch at 3d71d2d: 13 → 4, 12 → 3, 13 → 7 and 21 → 1 pieces, no pane on a print. Details and the two issues left as they were are in the verification comment.

Faces printed on clothes (a merch shirt with the hosts' faces) sat 2 face
heights under the wearer's face and counted as extra people, so a host's
close-up became a split onto the shirt. A painting on the wall at a low
detector score wobbled just enough to pass the static-face test and made a
two-shot a crowd. On a multi-camera podcast cutting every 1-3 s, deciding
every shot on its own changed the layout 13 times in 30 s.

- liveFaces: static pictures (now also a picture re-detected after a cut
  whose landmarks hold still in its box) and faces on a torso under a
  bigger face are dropped before any layout rule; every caller uses it,
  and active speaker detection drops prints per frame before seat matching.
- settleLayouts: an inner shot under 2 s, or a 3 s blip between two face
  crops, splits or stacks, takes a neighbour's layout when that layout can
  show the shot, framed on the shot's own faces.
- framing eval: three Bad Friends cases with printed-face, segments per
  minute and shortest-segment checks, incl. a lasting two-shot that must
  stay split.

Signed-off-by: dillonstreator <dillonstreator@gmail.com>
Signed-off-by: dillonstreator <dillonstreator@gmail.com>
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reelsaw-website Ready Ready Preview Dec 2, 2026 7:32pm UTC

Request Review

Signed-off-by: dillonstreator <dillonstreator@gmail.com>
@dillonstreator
dillonstreator merged commit 61b48c1 into main Dec 2, 2026
17 checks passed
@dillonstreator dillonstreator mentioned this pull request Dec 2, 2026
@dillonstreator

Copy link
Copy Markdown
Member Author

Verified on a local instance

Build: this branch at 3d71d2d (the later commits only touch tests and lint baselines), swapped in for the app container while its queue was idle. I re-rendered four reframe: auto clips from three Bad Friends episodes and checked a frame every 2 s of each output.

clip pieces before after
Ep 348, 38:15-38:45 (the report) 13: fit 2.3, split 3.5, stack 5.0, fit 1.0, split 1.0, face 1.0, split 7.0, … 4: fit 2.3, face 2.0, stack 7.5, face 18.6
Ep 348, 8:47-9:28 12 3: face 18.4, split 18.9, face 3.7
Ep 347 13 7: its 7 s and 8 s two-shots are still split
Ep 344 21 1: face 41.9

On every sheet, no pane or crop sits on a shirt print or the painting. The host close-ups are face crops on the host, and the short couch cutaways show the larger guest.

Not changed here, and not caused by this PR:

  • On the reported clip, the first 2.3 s is still fit because the text-heavy rule reads the logos around a host close-up as a slide.
  • On Ep 348 8:47-9:28, a 13 s picture-in-picture graphic (a phone video beside three webcam tiles) is split across two of the tiles.

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