| # TopoSlots Text Prompt 设计方案 |
|
|
| ## 核心问题 |
|
|
| 我们的模型接收 **text + target_skeleton** 双条件输入。text prompt 该怎么设计? |
| |
| ``` |
| 生成管线: text prompt + skeleton graph → SlotAssignment → MaskGIT → Decoder → motion |
| ↑ ↑ |
| 描述什么动作 决定什么骨架 |
| ``` |
| |
| ## 设计决策 |
| |
| ### 决策 1:拓扑信息是否放入 prompt? |
| |
| **结论:不放**。理由: |
| |
| 1. **架构已分离**:骨架拓扑通过 skeleton graph 独立输入(SkeletonEncoder + SlotAssignment),text 不需要重复编码拓扑 |
| 2. **跨骨架泛化**:如果 prompt 包含 "a dog walks",模型就被绑定到 dog 骨架。但 "walks forward" 可以复用到任何四足/双足 |
| 3. **可用性**:用户在推理时可以自由组合 "任意 text × 任意 skeleton",例如把 "walks forward" 应用到新见的骨架上 |
| 4. **标注效率**:不需要为每个骨架重写 prompt |
| |
| **但有一个例外**:物种名可以作为**可选前缀标签**出现,用于训练时的语义对齐,推理时可以省略。 |
| |
| ``` |
| 训练时: "[dog] walks forward and sits down" ← 方括号内为可选物种标签 |
| 推理时: "walks forward and sits down" ← 纯动作描述 |
| 推理时: "[cat] walks forward and sits down" ← 也可以加物种提示 |
| ``` |
| |
| ### 决策 2:动作描述粒度 |
| |
| 三个级别,**只要求 L1,鼓励 L2,L3 可选**: |
| |
| | 级别 | 格式 | 示例 | 标注成本 | 用途 | |
| |------|------|------|:--------:|------| |
| | **L1: 动作标签** | 1-3 个词 | `walk`, `run`, `attack`, `idle` | 极低 | 分类、检索、baseline 条件 | |
| | **L2: 短描述** | 1 句话,10-20 词 | `walks forward slowly then stops` | 中等 | 主要训练条件 | |
| | **L3: 详细描述** | 2-3 句话 | `The creature begins walking at a steady pace, gradually slowing down. It pauses briefly, shifts weight, then stops.` | 高 | 精细控制、评估 | |
| |
| **L2 是核心**——在标注成本和语义丰富度之间取得平衡。 |
| |
| ### 决策 3:描述应该是骨架无关的(Skeleton-Agnostic) |
| |
| **关键原则:描述"做什么"而不是"怎么做"。** |
| |
| | ✅ 好的描述 (骨架无关) | ❌ 差的描述 (骨架特定) | |
| |---|---| |
| | `walks forward` | `moves left leg then right leg alternately` | |
| | `attacks with its mouth` | `opens jaw joint 15 degrees then closes` | |
| | `flies in a circle` | `flaps left wing up 45 degrees, right wing follows` | |
| | `stands idle, looking around` | `rotates head joint on spine3` | |
| | `runs and jumps over obstacle` | `extends both hind legs while fore legs tuck` | |
| |
| **为什么**: |
| - "walks forward" 对人类 22 关节、狗 55 关节、蜘蛛 71 关节都有意义 |
| - "moves left leg then right leg" 假设了双足结构,蜘蛛 8 条腿怎么办? |
| - 模型的 slot assignment + decoder 会自己决定哪些关节参与 "walk" |
| |
| ### 决策 4:物种通用动作词汇表 |
| |
| 标准化动作词汇,跨物种通用: |
| |
| ``` |
| == 运动类 == |
| walk, run, sprint, trot, gallop, crawl, slither, swim, fly, hover, glide |
| |
| == 姿态类 == |
| stand, sit, lie down, crouch, squat, rear up, perch |
| |
| == 交互类 == |
| attack, bite, claw, kick, charge, ram, pounce, grab |
| |
| == 情绪/状态类 == |
| idle, alert, sleep, eat, drink, shake, scratch, groom |
| |
| == 转场类 == |
| turn left/right, start, stop, accelerate, decelerate, transition |
| ``` |
| |
| 这些词对人类和动物都有意义(人类也可以 "crouch", "charge", "idle")。 |
| |
| --- |
| |
| ## 标注规范 (更新版) |
| |
| ### 每条 motion 的标注格式 |
| |
| ```json |
| { |
| "motion_id": "Dog_0001", |
| "labels": { |
| "L1_action": "walk", |
| "L1_action_secondary": "turn", |
| "L2_short": "walks forward then turns right", |
| "L3_detailed": "The creature walks forward at a moderate pace for several steps, then smoothly turns to the right while maintaining balance.", |
| "species_tag": "dog", |
| "species_category": "quadruped" |
| } |
| } |
| ``` |
| |
| ### 标注优先级 |
| |
| | 优先级 | 数据集 | 当前状态 | 需要做什么 | |
| |:------:|--------|---------|-----------| |
| | **P0** | HumanML3D | 100% L2 文本 | 补充 L1 标签(可从文本自动提取) | |
| | **P1** | Truebones Zoo | 80% L2 文本 | 补全剩余 20%;补充 L1 标签 | |
| | **P2** | LAFAN1 | 0% | 从文件名提取 L1(`aiming`, `dance`, `fight`...);VLM 生成 L2 | |
| | **P2** | 100Style | 0% | 从文件名提取 L1 + style 标签(`happy_walk`, `tired_run`...) | |
| | **P3** | Bandai Namco | 0% | 有 JSON metadata 可提取;VLM 补 L2 | |
| | **P3** | CMU MoCap | 0% | 从目录名提取 L1(subject/action 编号) | |
| | **P4** | Mixamo | 0% | 从文件名 hash→原始动画名映射 | |
|
|
| ### 低成本批量标注方案 |
|
|
| **Phase 1:自动提取 L1 标签**(零人工成本) |
| ``` |
| LAFAN1 文件名: "aiming1_subject1.bvh" → L1="aim" |
| 100Style: "Happy_FW.bvh" → L1="walk", style="happy" |
| Bandai Namco: JSON metadata → L1 直接可用 |
| CMU: 目录结构 → L1 分类 |
| ``` |
|
|
| **Phase 2:VLM 自动生成 L2 短描述** |
| - 渲染骨架动画为 stick figure 视频 |
| - 送入 VLM (GPT-4o / Qwen2.5-VL) 生成 L2 描述 |
| - 模板 prompt: `"Describe the motion of this creature in one sentence. Focus on WHAT it does, not HOW its body parts move."` |
|
|
| **Phase 3:人工审核 + 修正**(只审核 VLM 输出,不从零写) |
|
|
| --- |
|
|
| ## 训练时的 Text Conditioning 策略 |
|
|
| ```python |
| # 训练时随机选择条件级别(鼓励模型学习多粒度) |
| if has_L3 and random() < 0.2: |
| text = sample['L3_detailed'] |
| elif has_L2 and random() < 0.7: |
| text = sample['L2_short'] |
| elif has_L1: |
| text = sample['L1_action'] |
| else: |
| text = "" # unconditional (CFG dropout) |
| |
| # 可选:加物种标签前缀 |
| if random() < 0.5 and has_species: |
| text = f"[{sample['species_tag']}] {text}" |
| ``` |
|
|
| ### Classifier-Free Guidance 设计 |
|
|
| ``` |
| 10% 概率: text = "" (完全无条件 → 学习 unconditional motion prior) |
| 10% 概率: text = L1 only (极简条件 → 学习粗粒度控制) |
| 60% 概率: text = L2 short (主要条件) |
| 20% 概率: text = L3 detailed (精细条件) |
| |
| skeleton 始终提供 (不 dropout skeleton 条件) |
| ``` |
|
|
| --- |
|
|
| ## 与竞争方法的对比 |
|
|
| | 方法 | Text 设计 | 骨架条件 | 跨骨架泛化 | |
| |------|---------|---------|:---------:| |
| | **HumanML3D** | 自由文本,包含 "a person" | 无(固定 SMPL) | ✗ | |
| | **NECromancer** | VLM 自动文本 | skeleton 分离 | ✓ (tokenizer) | |
| | **T2M4LVO** | 多粒度文本,含物种名 | 无 | ✗ | |
| | **AnyTop** | 无文本条件 | skeleton 分离 | ✓ | |
| | **TopoSlots (ours)** | **L1+L2+L3 多粒度,骨架无关,可选物种标签** | **skeleton 分离** | **✓ (生成)** | |
|
|
| **我们的优势**: |
| 1. 文本和骨架完全解耦 → "walk" 可以应用到任何骨架 |
| 2. 多粒度条件 → 支持从粗到细的控制 |
| 3. 可选物种标签 → 训练时提供弱监督语义,推理时灵活组合 |
|
|
| --- |
|
|
| ## 总结:标注工作量评估 |
|
|
| | 阶段 | 工作量 | 产出 | |
| |------|--------|------| |
| | L1 自动提取 | ~1 天(脚本) | 所有数据集 100% L1 标签 | |
| | L2 VLM 生成 | ~2 天(GPU) | 缺失数据集 ~9K 条 L2 描述 | |
| | L2 人工审核 | ~3-5 天 | 质量保证 | |
| | L3 详细描述 | 可选 | 仅 HumanML3D 已有 | |
|
|
| **结论:L1 可以零成本自动化,L2 用 VLM 生成+人工审核,L3 暂不需要。总人工投入约 3-5 天。** |
|
|