# nv-tlabs/kimodo architecture

> Architecture diagram of the GitHub repository nv-tlabs/kimodo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nv-tlabs/kimodo
- Repository: https://github.com/nv-tlabs/kimodo

## Overview

Kimodo generates text- and constraint-conditioned human or robot motion, then post-processes and exports it; it also provides an interactive authoring UI and a generation benchmark. The graph retains the documented product branches and the sampled model, representation, skeleton, visualization, and export layers. Several entry points and benchmark links are documented rather than source-sampled, so those edges cite the README; unsampled implementation details are not inferred.

Main entry points: [`kimodo/model/kimodo_model.py`](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/model/kimodo_model.py) (Kimodo sampler), [`kimodo/exports/motion_io.py`](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/motion_io.py) (Motion I/O), [`kimodo/motion_rep/reps/kimodo_motionrep.py`](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/motion_rep/reps/kimodo_motionrep.py) (Motion representation), [`kimodo/metrics`](https://github.com/nv-tlabs/kimodo/tree/main/kimodo/metrics) (Generation benchmark)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Motion generation"]
  node_cli["Generation CLI<br/>[generate.py]"]
  node_model["Kimodo sampler<br/>[kimodo_model.py]"]
  node_text["Text encoder<br/>[llm2vec.py]"]
  node_denoiser["Diffusion denoiser<br/>[diffusion.py]"]
  node_constraints["Kinematic constraints<br/>[constraints.py]"]
  node_post["Motion postprocess<br/>[postprocess.py]"]
  node_cppcorrect["Trajectory correction<br/>[Utility.cpp]"]
end

subgraph group_motion["Motion data"]
  node_representation["Motion representation"]
  node_features["Feature operations<br/>[feature_utils.py]"]
  node_smoothing["Root smoothing<br/>[smooth_root.py]"]
  node_skeleton["Skeleton kinematics<br/>[kinematics.py]"]
  node_io["Motion I/O<br/>[motion_io.py]"]
  node_mujoco["MuJoCo conversion<br/>[mujoco.py]"]
  node_bvh["BVH export<br/>[bvh.py]"]
  node_smplx["SMPL-X export<br/>[smplx.py]"]
end

subgraph group_authoring["Interactive authoring"]
  node_demo["Interactive demo<br/>[gui.py]"]
  node_constraintui["Constraint timeline<br/>[constraint_ui.py]"]
  node_scene["3D scene<br/>[scene.py]"]
  node_playback["Motion playback<br/>[playback.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_benchmark["Generation benchmark"]
  node_metricbase["Metric interfaces<br/>[base.py]"]
  node_footmetric["Foot-skate metric<br/>[foot_skate.py]"]
  node_tmrmetric["TMR metric<br/>[tmr.py]"]
end

node_user(("User"))

node_user -->|"runs generation"| node_cli
node_cli -->|"invokes sampling"| node_model
node_model -->|"encodes prompts"| node_text
node_model -->|"samples with"| node_denoiser
node_model -->|"builds conditions"| node_constraints
node_model -->|"conditions motion"| node_representation
node_model -->|"post-processes"| node_post
node_post -->|"corrects motion"| node_cppcorrect
node_representation -->|"computes features"| node_features
node_representation -->|"uses smoother"| node_smoothing
node_representation -->|"queries kinematics"| node_skeleton
node_post -->|"applies constraints"| node_constraints
node_user -->|"authors motion"| node_demo
node_demo -->|"edits constraints"| node_constraintui
node_constraintui -->|"updates scene"| node_scene
node_demo -->|"plays motion"| node_playback
node_model -.->|"exports results"| node_io
node_io -->|"completes motion"| node_skeleton
node_io -->|"converts motion"| node_mujoco
node_io -->|"writes BVH"| node_bvh
node_io -->|"exports SMPL-X"| node_smplx
node_user -->|"evaluates models"| node_benchmark
node_benchmark -->|"uses metric interface"| node_metricbase
node_benchmark -->|"measures foot skate"| node_footmetric
node_benchmark -->|"measures text alignment"| node_tmrmetric

click node_cli "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/scripts/generate.py"
click node_model "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/model/kimodo_model.py"
click node_text "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/model/llm2vec/llm2vec.py"
click node_denoiser "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/model/diffusion.py"
click node_constraints "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/constraints.py"
click node_post "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/postprocess.py"
click node_cppcorrect "https://github.com/nv-tlabs/kimodo/blob/main/MotionCorrection/src/cpp/AnimProcessing/Utility.cpp"
click node_representation "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/motion_rep/reps/kimodo_motionrep.py"
click node_features "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/motion_rep/feature_utils.py"
click node_smoothing "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/motion_rep/smooth_root.py"
click node_skeleton "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/skeleton/kinematics.py"
click node_io "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/motion_io.py"
click node_mujoco "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/mujoco.py"
click node_bvh "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/bvh.py"
click node_smplx "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/smplx.py"
click node_demo "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/viz/gui.py"
click node_constraintui "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/viz/constraint_ui.py"
click node_scene "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/viz/scene.py"
click node_playback "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/viz/playback.py"
click node_benchmark "https://github.com/nv-tlabs/kimodo/tree/main/kimodo/metrics"
click node_metricbase "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/metrics/base.py"
click node_footmetric "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/metrics/foot_skate.py"
click node_tmrmetric "https://github.com/nv-tlabs/kimodo/blob/main/kimodo/metrics/tmr.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_model,node_text,node_denoiser,node_constraints,node_post,node_cppcorrect,node_user toneBlue
class node_representation,node_features,node_smoothing,node_skeleton,node_io,node_mujoco,node_bvh,node_smplx toneAmber
class node_demo,node_constraintui,node_scene,node_playback toneMint
class node_benchmark,node_metricbase,node_footmetric,node_tmrmetric toneRose
```

## Components

### Motion generation

- [Generation CLI](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/scripts/generate.py): `kimodo/scripts/generate.py`
- [Kimodo sampler](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/model/kimodo_model.py): `kimodo/model/kimodo_model.py`
- [Text encoder](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/model/llm2vec/llm2vec.py): `kimodo/model/llm2vec/llm2vec.py`
- [Diffusion denoiser](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/model/diffusion.py): `kimodo/model/diffusion.py`
- [Kinematic constraints](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/constraints.py): `kimodo/constraints.py`
- [Motion postprocess](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/postprocess.py): `kimodo/postprocess.py`
- [Trajectory correction](https://github.com/nv-tlabs/kimodo/blob/main/MotionCorrection/src/cpp/AnimProcessing/Utility.cpp): `MotionCorrection/src/cpp/AnimProcessing/Utility.cpp`

### Motion data

- [Motion representation](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/motion_rep/reps/kimodo_motionrep.py): `kimodo/motion_rep/reps/kimodo_motionrep.py`
- [Feature operations](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/motion_rep/feature_utils.py): `kimodo/motion_rep/feature_utils.py`
- [Root smoothing](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/motion_rep/smooth_root.py): `kimodo/motion_rep/smooth_root.py`
- [Skeleton kinematics](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/skeleton/kinematics.py): `kimodo/skeleton/kinematics.py`
- [Motion I/O](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/motion_io.py): `kimodo/exports/motion_io.py`
- [MuJoCo conversion](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/mujoco.py): `kimodo/exports/mujoco.py`
- [BVH export](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/bvh.py): `kimodo/exports/bvh.py`
- [SMPL-X export](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/exports/smplx.py): `kimodo/exports/smplx.py`

### Interactive authoring

- [Interactive demo](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/viz/gui.py): `kimodo/viz/gui.py`
- [Constraint timeline](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/viz/constraint_ui.py): `kimodo/viz/constraint_ui.py`
- [3D scene](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/viz/scene.py): `kimodo/viz/scene.py`
- [Motion playback](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/viz/playback.py): `kimodo/viz/playback.py`

### Evaluation

- [Generation benchmark](https://github.com/nv-tlabs/kimodo/tree/main/kimodo/metrics): `kimodo/metrics`
- [Metric interfaces](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/metrics/base.py): `kimodo/metrics/base.py`
- [Foot-skate metric](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/metrics/foot_skate.py): `kimodo/metrics/foot_skate.py`
- [TMR metric](https://github.com/nv-tlabs/kimodo/blob/main/kimodo/metrics/tmr.py): `kimodo/metrics/tmr.py`

### Other components

- **User**

## Connections

- User → Generation CLI: runs generation (evidence: `README.md`)
- Generation CLI → Kimodo sampler: invokes sampling (evidence: `README.md`)
- Kimodo sampler → Text encoder: encodes prompts (evidence: `kimodo/model/kimodo_model.py`)
- Kimodo sampler → Diffusion denoiser: samples with (evidence: `kimodo/model/kimodo_model.py`)
- Kimodo sampler → Kinematic constraints: builds conditions (evidence: `kimodo/model/kimodo_model.py`)
- Kimodo sampler → Motion representation: conditions motion (evidence: `kimodo/model/kimodo_model.py`)
- Kimodo sampler → Motion postprocess: post-processes (evidence: `kimodo/model/kimodo_model.py`)
- Motion postprocess → Trajectory correction: corrects motion (evidence: `kimodo/postprocess.py`)
- Motion representation → Feature operations: computes features (evidence: `kimodo/motion_rep/reps/kimodo_motionrep.py`)
- Motion representation → Root smoothing: uses smoother (evidence: `kimodo/motion_rep/reps/kimodo_motionrep.py`)
- Motion representation → Skeleton kinematics: queries kinematics (evidence: `kimodo/motion_rep/reps/kimodo_motionrep.py`)
- Motion postprocess → Kinematic constraints: applies constraints (evidence: `kimodo/postprocess.py`)
- User → Interactive demo: authors motion (evidence: `README.md`)
- Interactive demo → Constraint timeline: edits constraints (evidence: `kimodo/viz/constraint_ui.py`)
- Constraint timeline → 3D scene: updates scene (evidence: `kimodo/viz/constraint_ui.py`)
- Interactive demo → Motion playback: plays motion (evidence: `README.md`)
- Kimodo sampler → Motion I/O: exports results
- Motion I/O → Skeleton kinematics: completes motion (evidence: `kimodo/exports/motion_io.py`)
- Motion I/O → MuJoCo conversion: converts motion (evidence: `kimodo/exports/motion_io.py`)
- Motion I/O → BVH export: writes BVH (evidence: `kimodo/exports/motion_io.py`)
- Motion I/O → SMPL-X export: exports SMPL-X (evidence: `kimodo/exports/motion_io.py`)
- User → Generation benchmark: evaluates models (evidence: `README.md`)
- Generation benchmark → Metric interfaces: uses metric interface (evidence: `kimodo/metrics/foot_skate.py`)
- Generation benchmark → Foot-skate metric: measures foot skate (evidence: `README.md`)
- Generation benchmark → TMR metric: measures text alignment (evidence: `README.md`)
