Skip to content

fix(postprocess): 逐帧补偿一段动作内的单调尺度漂移 - #308

Open
johnnyzhang-eng wants to merge 2 commits into
1024XEngineer:mainfrom
johnnyzhang-eng:fix/scale-drift-within-action
Open

fix(postprocess): 逐帧补偿一段动作内的单调尺度漂移#308
johnnyzhang-eng wants to merge 2 commits into
1024XEngineer:mainfrom
johnnyzhang-eng:fix/scale-drift-within-action

Conversation

@johnnyzhang-eng

Copy link
Copy Markdown
Contributor

Refs #307

角色在一段动作内单调变大。线上真实产出实测:walk 本体高 137→165(+20.3%),custom 70→158(+126.6%),几乎无回落,是趋势不是噪声。

align_bottom_center 按设计整段共用一个缩放系数,而 i2v 会引入推镜/角色走向镜头。统一缩放对整段乘同一个数,趋势原样保留。#280 修的是定标基准被延展物撑大(跨动作口径),与本条不重叠。

改法不是逐帧归一——那会把走路自然的身高起伏(约 4%)一起压平,蹲下的帧被放大、伸展的帧被缩小,正是本模块最初拒绝它的原因。新增 scale_drift:对逐帧本体高做一次线性拟合,只除掉趋势项、保留残差;补偿系数以 1.0 为中心,故整段平均尺寸不变,跨动作口径不受影响。首尾变化低于 8% 时不动,免得把真实起伏当漂移消掉。

拿线上那两段真实数据验证:walk 修后首尾 −0.1%、残差 1.5%;custom 修后 −3.7%、残差 6.7%。

测试用的是线上产物的真实逐帧数值。变异验证三个方向都被杀死:补偿没接上(这条第一版没覆盖,是变异测试逮出来的,已补端到端用例)、退化成逐帧归一、门槛设为 0 导致过度矫正。

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
windup Ignored Ignored Preview Aug 14, 2026 8:54am

@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ai_engine/src/windup_ai_engine/postprocess/pack.py 96.77% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one correctness regression in the new drift-compensation path; see the inline comment.

Verification: focused tests and lint could not run because this environment lacks uv, pytest, ruff, and the project dependencies.

View job run

Comment thread backend/packages/ai_engine/src/windup_ai_engine/postprocess/pack.py Outdated
守卫用 len(spans) == len(frames) 判齐,而 spans 已滤掉空帧,于是序列里只要有一帧
量不到本体,整段补偿就被跳过,其余帧静默留着 i2v 的推镜漂移。

空帧只是缺一个观测:改为把 None 一并传给 scale_drift,它按真实帧号拟合、空位系数
取 1.0,其余帧照常补偿。
@johnnyzhang-eng

Copy link
Copy Markdown
Contributor Author

P1 成立,已修(2d791f8)。序列里有一帧空的,spans 被滤短,守卫为假,整段补偿被跳过——其余帧静默保留原有漂移。改成对非空帧计算并应用补偿,空帧原样透明输出,补了含空帧序列的用例与变异验证。

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