Repository navigation
Hold the face crop still through head and body sways - #439
Merged
Merged
Conversation
The tripod camera followed the face within 0.025 of the width and crept back to centre between pans, so every sway panned the crop. It now holds while the face box stays inside the 9:16 window less a 10% margin, and when the face would leave it, reads the next 2 s and makes one eased move that covers the excursion. The window is sized per layout (cropView), so split and stack panes plan for their own width. Framing eval: track cases score moves and window widths a minute and whether the face stays inside the window and its margin (cropMotion); two new cases from the report (Stavvy's World #203, Kill Tony #794). Signed-off-by: dillonstreator <dillonstreator@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Merged
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.
Problem
The face crop panned left and right every time the person swayed their head or body (reported on Stavvy's World #203 and Kill Tony #794, and seen in many clips).
tripodTrackhad a dead zone of 0.025 of the source width (about 8% of a 9:16 window). Between pans it also crept back to the face centre, so every nod and rock moved the crop.Fix: a lookahead dead zone (
tripodTrack,layout.ts)Window size. The crop window is what the frame shows (
cropView):Holding still. The camera holds while the whole face box stays inside the window less a 10% margin on each side. A tight close-up still gets 12% of the window to wander. There is no creep back to the centre.
Moving. When the face (3-sample average) is about to leave that zone, the camera reads the next 2 s and chooses one position that keeps the face inside for as long as one position can. That position is the median of where the face is over that time. It gets there in one smoothstep move:
The result is one move out and one move back per excursion, not a series of corrections.
Cuts. Scene cuts and missed cuts (
trackBreaks) still cut. Each stretch is planned on its own, and a move that would run past a cut stops at it.Unchanged. Target choice is untouched: Follow the talker shot by shot, over any number of faces, without jitter #436's per-shot talker following, its 1.5 s switch delay and its 0.6 s ease between people (
talkerTrack), and Keep printed faces out of auto layout and stop per-shot layout churn #438's printed-face filter and layout hysteresis. This change only affects the path the crop takes on one person.The new constants are
TRIPOD, documented indocs/LAYOUTS.mdunder "The crop's path".Evals (
framingsuite, run offline from committed face samples)Track cases now score:
movesPerMin: separate moves a minute;panPerMin: window widths slid a minute;inView/inMargin: the share of frames whose face box lies inside the 9:16 window, and inside it less the 10% margin.These come from
cropMotion. Per-shotsubjectlabels pick the person when others share the shot (the Kill Tony panel), so a case scores the crop path rather than target choice.New cases from the report:
track-sway-podcast-closeup: Stavvy's World Release #203, clip2c83b6ab;track-sway-standup-mic: Kill Tony #794, clipac188505; the comic rocks at the mic, with the band and panel in the shot."Before" is
main'stripodTrackwith the new metrics.worstSpeakerOffsetwent from 0.045 to 0.002.track-4x3-interviewandtrack-closeup-settleused to require the crop to settle within 30 px of the face centre. That is exactly the creep this removes, so they now ask for the face to stay inside the window and its margin, plus a moves-per-minute cap. Both notes say so.track-recentre-after-cardkeeps its centring and recentre checks.speakerssuite: run with LR-ASD, all 9 cases pass. The follow cases are still on the talker 1.00 (comic-across-cuts) and 0.98 (three-at-the-desk) of the time.Verified on a local instance
reelsaw:clipfarm-swayat3f78b059. The clips were rendered with the instance's normal settings.layout_segments[].track, sampled at 1 s). They count "moving" 1 s steps, which includes snaps at cuts.a54a071fcuts every 1–2 s between two cameras (x 0.51 / 0.71). Its remaining steps are snaps at those cuts; within shots the crop now holds (for example 22–24 s and 34–39 s).Frame strips at 2 fps (top: before, bottom: after) show that the background no longer slides while the person sways inside the frame.
Also
apps/server/test/tripod.test.tscover:docs/LAYOUTS.mdanddocs/EVALS.mdare updated, and there is a changeset.