fix(generation): 无地面接触的动作按躯干中心对齐 - #564
Open
johnnyzhang-eng wants to merge 1 commit into
Open
Conversation
飞 / 游 / 攀全程没有地面接触,包围盒底边是尾羽与爪子、逐帧在变,钉死底边身体反而 上下浮动。这类动作只能以 custom 进来,故由调用方沿请求链显式声明,不按描述文字猜; jump 腾空但要回地,仍走脚线。 Refs 1024XEngineer#534
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
已按固定提交范围 17b25a723410244d9f0a68209d3c946ca0698b56...3a988aef17a389ee324c5673dcd13e5858a62051 完整检查本 PR。质心锚点的几何计算、默认脚线行为、jump/custom 的动作映射,以及 HTTP → 持久化/MQ → worker → 引擎的 ground_contact 传递彼此一致,未发现达到报告阈值的新增正确性、兼容性或安全问题。
验证:所有变更 Python 文件均通过 AST 编译检查,git diff --check 无输出;未能运行 pytest,因为当前环境未安装 pytest 及项目运行依赖。
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.
Closes #534
align_bottom_center垂直方向按包围盒底边对齐到foot_line。飞 / 游 / 攀全程没有地面接触,底边是尾羽与爪子、逐帧在变,钉死底边等于让身体跟着延展物反向浮动。新增
anchor参数(foot/centroid),质心那档落在foot_line - fill_h/2,即参考姿态包围盒的纵向中心,所以换锚点不改变构图也不改变尺寸。fill_h/fill_w/ref_height那套定标一行未动。不在后端按动作名猜。 引擎的类型体系里没有「全程无地面」这个信息,飞 / 游 / 攀只能以 CUSTOM 进来;jump 腾空但要回地,仍走脚线。所以由调用方沿请求链显式声明,非 CUSTOM 传了直接报错而不是静默忽略。贯通链:
web/api/generation.py:204→:442→orchestrator/model.py:84→service.py:51(asdict 落库)→ MQ →worker/handlers.py:87(重建)→executor.py:343,347,349→:390→common/models/character.py:248→strategy/base.py:64,70→character_generator.py:189,247,270→ 消费点postprocess/pack.py:297-301缺陷的量
躯干 std 改前改后的对比不能当证据:质心锚点按定义就是把躯干中心钉在固定线上,它的躯干 std 趋近零是定义不是疗效。换一个这个修法不直接优化的量 —— 「包围盒底边到躯干中心的距离」,它逐帧变多少,脚线锚点就把身体推动多少。43 条线上已交付序列:
单位是占画布高的比例。custom 是 walk 的 3.4 倍;最差的 #197 极差达到 0.3398 —— 脚线锚点会把画布高 34% 的延展物长度变化注入到身体位置上。
这批数里有一条 walk(#69)也高达 0.1077,说明这个驱动量是逐序列的而非按动作名可推,正好是本 PR 走显式声明而不走动作名查表的理由。
验证
六个变异体全部转红(脚本 +
try/finally,结束校验 sha256 还原):_lastmile不传anchor=vertical_anchor恒返回脚线_action_input丢掉该字段(MQ 那一环)ActionSpec有地面接触那侧不变:默认出帧与显式
anchor="foot"逐像素相同,脚线仍落在 0.92(43 条真实序列重对齐后脚线中位 0.9180)。core_span的行方向改走_core_rows(本体的位置与跨度共用一把尺子),重构前后在 600 个随机样本上对拍 0 例不一致。本分支验证:
ruff check .通过、lint-imports2 kept 0 broken、export_openapi后openapi.json无漂移、pytest -q1351 passed / 14 skipped。未覆盖
frontend/src/entities/generation/api.ts:611-619只在 custom 时发loop,不发ground_contact。在补 UI 之前,从网页提交的「飞」仍按脚线对齐。0.39*ch,悬在躯干中心以下超过约0.63×参考高的部分会被裁,而pack.py现有的溢出日志只覆盖宽度。这是既有缺口,未扩。与 #524 有文件重叠(
orchestrator/executor.py、character_generator.py),改动位置不同,先合哪个都需要另一个 rebase。