# inkcat520/ggmotion architecture

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

- Interactive diagram: https://gitdiagram.com/inkcat520/ggmotion
- Repository: https://github.com/inkcat520/ggmotion

## Overview

GGMotion is a human-motion prediction research application supporting Human3.6M, CMUMocap, and 3DPW, with short- and long-horizon training, evaluation, and visualization. Its main workflow is to load dataset sequences, construct the GGMNet predictor, train or evaluate it, and save or visualize results. The graph distinguishes dataset-specific entry points and loaders from shared model and utility layers. Relationships are based on the supplied excerpts, SOURCE INDEX references, and README; some runtime internals are not fully shown.

Main entry points: [`main_h36m.py`](https://github.com/inkcat520/ggmotion/blob/master/main_h36m.py) (Human3.6M runner), [`utils/runtime.py`](https://github.com/inkcat520/ggmotion/blob/master/utils/runtime.py) (Train and evaluate), [`main_cmu.py`](https://github.com/inkcat520/ggmotion/blob/master/main_cmu.py) (CMU runner), [`main_3dpw.py`](https://github.com/inkcat520/ggmotion/blob/master/main_3dpw.py) (3DPW runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Experiment workflow"]
  node_h36m_app["Human3.6M runner<br/>[main_h36m.py]"]
  node_cmu_app["CMU runner<br/>[main_cmu.py]"]
  node_pw_app["3DPW runner<br/>[main_3dpw.py]"]
  node_experiment_cfg["Experiment settings"]
  node_trainer_eval["Train and evaluate<br/>[runtime.py]"]
  node_saved_results[("Checkpoints and results")]
end

subgraph group_datasets["Motion datasets"]
  node_h36m_data["Human3.6M sequences<br/>[data_loader.py]"]
  node_cmu_data["CMU sequences<br/>[data_loader.py]"]
  node_pw_data["3DPW sequences<br/>[data_loader.py]"]
end

subgraph group_prediction["Prediction model"]
  node_ggmnet["GGMNet predictor<br/>[model.py]"]
  node_model_layers["Embedding layers<br/>[modules.py]"]
end

subgraph group_support["Shared utilities"]
  node_pose_utils["Pose data utilities<br/>[data_utils.py]"]
  node_kinematics["Forward kinematics<br/>[kinematics.py]"]
  node_visualization["Pose visualization<br/>[viz.py]"]
end

node_user(("Research user"))

node_user -->|"runs"| node_h36m_app
node_user -->|"runs"| node_cmu_app
node_user -->|"runs"| node_pw_app
node_experiment_cfg -->|"configures"| node_h36m_app
node_experiment_cfg -->|"configures"| node_cmu_app
node_experiment_cfg -->|"configures"| node_pw_app
node_h36m_app -->|"loads"| node_h36m_data
node_cmu_app -->|"loads"| node_cmu_data
node_pw_app -->|"loads"| node_pw_data
node_h36m_data -->|"uses"| node_pose_utils
node_cmu_data -->|"uses"| node_pose_utils
node_pw_data -->|"uses"| node_pose_utils
node_pose_utils -->|"uses"| node_kinematics
node_h36m_app -->|"constructs"| node_ggmnet
node_cmu_app -->|"constructs"| node_ggmnet
node_pw_app -->|"constructs"| node_ggmnet
node_ggmnet -->|"uses"| node_model_layers
node_h36m_app -->|"invokes"| node_trainer_eval
node_cmu_app -->|"invokes"| node_trainer_eval
node_pw_app -->|"invokes"| node_trainer_eval
node_trainer_eval -->|"saves"| node_saved_results
node_trainer_eval -->|"uses"| node_visualization
node_h36m_app -->|"requests visualization"| node_trainer_eval

click node_h36m_app "https://github.com/inkcat520/ggmotion/blob/master/main_h36m.py"
click node_cmu_app "https://github.com/inkcat520/ggmotion/blob/master/main_cmu.py"
click node_pw_app "https://github.com/inkcat520/ggmotion/blob/master/main_3dpw.py"
click node_experiment_cfg "https://github.com/inkcat520/ggmotion/tree/master/cfg"
click node_trainer_eval "https://github.com/inkcat520/ggmotion/blob/master/utils/runtime.py"
click node_saved_results "https://github.com/inkcat520/ggmotion/tree/master/exp"
click node_h36m_data "https://github.com/inkcat520/ggmotion/blob/master/utils/data_loader.py"
click node_cmu_data "https://github.com/inkcat520/ggmotion/blob/master/utils/data_loader.py"
click node_pw_data "https://github.com/inkcat520/ggmotion/blob/master/utils/data_loader.py"
click node_pose_utils "https://github.com/inkcat520/ggmotion/blob/master/utils/data_utils.py"
click node_kinematics "https://github.com/inkcat520/ggmotion/blob/master/utils/kinematics.py"
click node_ggmnet "https://github.com/inkcat520/ggmotion/blob/master/module/model.py"
click node_model_layers "https://github.com/inkcat520/ggmotion/blob/master/module/modules.py"
click node_visualization "https://github.com/inkcat520/ggmotion/blob/master/utils/viz.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_h36m_app,node_cmu_app,node_pw_app,node_experiment_cfg,node_trainer_eval,node_saved_results,node_user toneBlue
class node_h36m_data,node_cmu_data,node_pw_data toneAmber
class node_ggmnet,node_model_layers toneMint
class node_pose_utils,node_kinematics,node_visualization toneRose
```

## Components

### Experiment workflow

- [Human3.6M runner](https://github.com/inkcat520/ggmotion/blob/master/main_h36m.py): `main_h36m.py`
- [CMU runner](https://github.com/inkcat520/ggmotion/blob/master/main_cmu.py): `main_cmu.py`
- [3DPW runner](https://github.com/inkcat520/ggmotion/blob/master/main_3dpw.py): `main_3dpw.py`
- [Experiment settings](https://github.com/inkcat520/ggmotion/tree/master/cfg): `cfg`
- [Train and evaluate](https://github.com/inkcat520/ggmotion/blob/master/utils/runtime.py): `utils/runtime.py`
- [Checkpoints and results](https://github.com/inkcat520/ggmotion/tree/master/exp): `exp`

### Motion datasets

- [Human3.6M sequences](https://github.com/inkcat520/ggmotion/blob/master/utils/data_loader.py): `utils/data_loader.py`
- [CMU sequences](https://github.com/inkcat520/ggmotion/blob/master/utils/data_loader.py): `utils/data_loader.py`
- [3DPW sequences](https://github.com/inkcat520/ggmotion/blob/master/utils/data_loader.py): `utils/data_loader.py`

### Prediction model

- [GGMNet predictor](https://github.com/inkcat520/ggmotion/blob/master/module/model.py): `module/model.py`
- [Embedding layers](https://github.com/inkcat520/ggmotion/blob/master/module/modules.py): `module/modules.py`

### Shared utilities

- [Pose data utilities](https://github.com/inkcat520/ggmotion/blob/master/utils/data_utils.py): `utils/data_utils.py`
- [Forward kinematics](https://github.com/inkcat520/ggmotion/blob/master/utils/kinematics.py): `utils/kinematics.py`
- [Pose visualization](https://github.com/inkcat520/ggmotion/blob/master/utils/viz.py): `utils/viz.py`

### Other components

- **Research user**

## Connections

- Research user → Human3.6M runner: runs (evidence: `README.md`)
- Research user → CMU runner: runs (evidence: `README.md`)
- Research user → 3DPW runner: runs (evidence: `README.md`)
- Experiment settings → Human3.6M runner: configures (evidence: `README.md`)
- Experiment settings → CMU runner: configures (evidence: `README.md`)
- Experiment settings → 3DPW runner: configures (evidence: `README.md`)
- Human3.6M runner → Human3.6M sequences: loads (evidence: `main_h36m.py`)
- CMU runner → CMU sequences: loads (evidence: `main_cmu.py`)
- 3DPW runner → 3DPW sequences: loads (evidence: `main_3dpw.py`)
- Human3.6M sequences → Pose data utilities: uses (evidence: `utils/data_loader.py`)
- CMU sequences → Pose data utilities: uses (evidence: `utils/data_loader.py`)
- 3DPW sequences → Pose data utilities: uses (evidence: `utils/data_loader.py`)
- Pose data utilities → Forward kinematics: uses (evidence: `utils/data_utils.py`)
- Human3.6M runner → GGMNet predictor: constructs (evidence: `main_h36m.py`)
- CMU runner → GGMNet predictor: constructs (evidence: `main_cmu.py`)
- 3DPW runner → GGMNet predictor: constructs (evidence: `main_3dpw.py`)
- GGMNet predictor → Embedding layers: uses (evidence: `module/model.py`)
- Human3.6M runner → Train and evaluate: invokes (evidence: `main_h36m.py`)
- CMU runner → Train and evaluate: invokes (evidence: `main_cmu.py`)
- 3DPW runner → Train and evaluate: invokes (evidence: `main_3dpw.py`)
- Train and evaluate → Checkpoints and results: saves
- Train and evaluate → Pose visualization: uses (evidence: `utils/runtime.py`)
- Human3.6M runner → Train and evaluate: requests visualization (evidence: `README.md`)
