feat(paper2video): group wrapped-line cues + card-aware ink-tighten spotlight - #25
Open
ArmandXiao wants to merge 1 commit into
Open
feat(paper2video): group wrapped-line cues + card-aware ink-tighten spotlight#25ArmandXiao wants to merge 1 commit into
ArmandXiao wants to merge 1 commit into
Conversation
…potlight Spotlight now composes two stages instead of drawing the raw declared box: - generate_visual_cues.py: union same-group single-line title/tagline fragments into the whole wrapped unit before emitting the cue, so a cue that matched one line spotlights the whole title/tagline. Multi-line paragraph blocks are never merged, preserving the script's per-chunk progression. Gated by VIDEO_CUE_GROUP_WRAPPED_LINES + geometry env knobs. - render_video.py: shrink each spotlight box to the painted ink (glyphs) for transparent text so it hugs the content, but keep a filled card/panel whole via robust detection (dominant grid page_bg + border-ring uniformity that survives an accent bar). Feather/dim + card thresholds are now env-tunable (same defaults); best-effort, degrades to the declared box without Pillow/numpy or on low confidence. Net: the spotlight tracks the intended logical unit tightly (text) or fully (cards) instead of the loose declared box. Backward-compatible superset.
|
@ArmandXiao please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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
The video spotlight previously drew the shape's raw declared box (PPTX
off/extor a semantic estimate), so it either dropped a wrapped title's second line or spotlighted a lot of empty leading/padding. This makes the spotlight track the intended logical unit — tightly for text, fully for cards — via two composed stages:generate_visual_cues.py) — before emitting a cue, union same-group single-line title/tagline fragments into the whole wrapped run, so a cue that matched one line spotlights the whole title/tagline. Multi-line paragraph blocks are never merged, preserving the script's per-chunk progression. Guarded byVIDEO_CUE_GROUP_WRAPPED_LINES+ geometry knobs (WRAP_X_EPS,WRAP_MIN_ASPECT,WRAP_GAP_FRAC).render_video.py) — shrink each spotlight box to the painted ink (glyphs) for transparent text so it hugs the content, but keep a filled card/panel whole via robust detection: page bg = the dominant colour over a coarse grid of the source slide (robust to a corner accent bar, unlike sampling the four corners), and the box is a card when most of its border ring hugs one fill colour (close_frac, which survives a thin accent bar on one edge) that differs from the page bg. Feather/dim + card thresholds are env-tunable (same defaults); best-effort — degrades to the declared box without Pillow/numpy or on low confidence.Architecture: grouping decides WHAT unit to highlight (structure domain); ink-tighten decides HOW tightly + preserves filled cards (pixel domain); per-chunk progression is untouched.
Files changed
ResearchStudio-Reel/skills/paper2video/scripts/render_video.py(+112): new_ink_tighten_box()(letterbox-aware, card detection),VisualCue.no_ink_tightenoverride, env-tunable feather/dim + card thresholds, wired intoencode_segment's spotlight loop.ResearchStudio-Reel/skills/paper2video/scripts/generate_visual_cues.py(+91): newunion_wrapped_line_cues()+ helpers, called once per slide before appending cues.Validation (new vs upstream-main render, identical deck+audio+cues)
Known follow-up (not in this PR)
VIDEO_SPOTLIGHT_FEATHER_PXalone is dominated by the ratio term (min(1920,1080) * 0.052 = 56), so setting onlyFEATHER_PXdoes not change the feather. MakingFEATHER_PXauthoritative (and picking a tighter default) is a small follow-up.