How facebookresearch/ai4animationpy works
AI4AnimationPy is a Python framework for motion-capture processing, neural-network training and inference, and character-animation visualization. A typical workflow imports motion, builds animation features, trains or runs a model, then applies predicted motion to a character in the ECS scene and optionally renders it. The README also documents standalone, headless, and manual execution, motion editing, IK, and rendering capabilities. The graph combines these documented capabilities with sampled demo behavior; some subsystem wiring is documented rather than visible in the excerpts.
Main entry points: Actor.py Character actor · Scene.py Scene and entities · Motion.py Motion representation · Models Neural models
Components 21
Runtime and ECS
- Framework runtime
ai4animation/AI4Animation.py - Scene and entities
ai4animation/Scene.py - ECS components
ai4animation/Components/Component.py
Motion Data
- Motion importers
ai4animation/Import - Motion representation
ai4animation/Animation/Motion.py - Dataset and modules
ai4animation/Animation/Dataset.py - GLB exporter
ai4animation/Export/GLBExporter.py
AI and Inference
- Feature tensors
ai4animation/AI/FeedTensor.py - Batch sampler
ai4animation/AI/DataSampler.py - Neural models
ai4animation/AI/Models - Training optimizers
ai4animation/AI/Optimizers
Character Animation
- Character actor
ai4animation/Components/Actor.py - Motion prediction
Demos/Locomotion/Biped/Program.py - Motion sequences
ai4animation/Animation/TimeSeries.py - FABRIK solver
ai4animation/IK/FABRIK.py - Animation math
ai4animation/Math/Transform.py
Visualization
- Motion editor
ai4animation/Components/MotionEditor.py - Render pipeline
ai4animation/Standalone/RenderPipeline.py - Skinned mesh
ai4animation/Standalone/SkinnedMesh.py
Other components
- Researcher / operator
- Motion files
Connections 23
- Researcher / operator → Framework runtime: selects mode
- Framework runtime → Scene and entities: runs callbacks
- Scene and entities → ECS components: manages lifecycle
- Motion files → Motion importers: provides files
- Motion importers → Motion representation: loads motion
- Motion representation → Dataset and modules: supplies clips
- Dataset and modules → Batch sampler: provides samples
- Batch sampler → Feature tensors: builds batches
- Feature tensors → Neural models: feeds tensors
- Neural models → Training optimizers: trains with
- Neural models → Motion prediction: predicts motion
- Researcher / operator → Motion prediction: controls character
- Motion prediction → Motion sequences: constructs sequence
- Motion sequences → Character actor: drives pose
- Character actor → FABRIK solver: solves joints
- FABRIK solver → Animation math: uses transforms
- Character actor → Skinned mesh: updates skin
- Motion editor → Dataset and modules: browses motion
- Motion editor → Character actor: displays character
- Scene and entities → Render pipeline: draws scene
- Render pipeline → Skinned mesh: renders skin
- Motion representation → GLB exporter: exports motion
- Character actor → Animation math: uses transforms