GameMaster-Mocap / README.md
vivekchakraverty's picture
Update README.md
3c2681d verified
---
title: GameMaster Mocap
emoji: πŸ•Ί
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.31.0
app_file: app.py
python_version: "3.12"
---
# 🎭 MotionBERT MoCap Studio
Convert any single-person video into a full-body **motion capture animation** exported as:
| File | Use |
|------|-----|
| `motion_capture.glb` | Blender armature import / three.js / Godot import |
| `animation.tres` | Godot 4 AnimationLibrary β€” text resource |
| `animation.res` | Godot 4 AnimationLibrary β€” binary resource |
> ⏱ **CPU space**: processing takes ~3-8 minutes per video depending on length.
> Upload a short clip (5-15 seconds) for the fastest results.
---
## Pipeline
| Step | Component |
|------|-----------|
| 1 | Frame extraction β€” up to 243 frames at uniform stride |
| 2 | Person detection β€” DETR (`facebook/detr-resnet-50`) every 15 frames |
| 3 | 2-D pose β€” ViTPose (`usyd-community/vitpose-base-simple-coco`) |
| 4 | 3-D lift β€” MotionBERT DSTformer (`walterzhu/MotionBERT`) |
| 5 | Export β€” GLB skeleton + Godot 4 `.tres` / `.res` |
---
## Bone Hierarchy (17 bones)
```
Hips ← root
β”œβ”€β”€ Spine
β”‚ └── Chest
β”‚ β”œβ”€β”€ Neck β†’ Head
β”‚ β”œβ”€β”€ LeftUpperArm β†’ LeftLowerArm β†’ LeftHand
β”‚ └── RightUpperArm β†’ RightLowerArm β†’ RightHand
β”œβ”€β”€ LeftUpperLeg β†’ LeftLowerLeg β†’ LeftFoot
└── RightUpperLeg β†’ RightLowerLeg β†’ RightFoot
```
---
## Using in Godot 4
```gdscript
var lib := load("res://animation.tres") as AnimationLibrary
$AnimationPlayer.add_animation_library("mocap", lib)
$AnimationPlayer.play("mocap/mocap")
```
## Using in Blender
File β†’ Import β†’ glTF 2.0 β†’ select `motion_capture.glb`