# wei-mao-2019/learntrajdep architecture

> Architecture diagram of the GitHub repository wei-mao-2019/learntrajdep, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wei-mao-2019/learntrajdep
- Repository: https://github.com/wei-mao-2019/learntrajdep

## Overview

This repository implements human-motion forecasting research workflows: users train or evaluate a graph-convolutional model on Human3.6M, CMU mocap, or 3DPW sequences, in angle or 3D-coordinate representations, and can visualize predictions. Dataset adapters prepare temporal sequences and DCT features; shared utilities handle motion data and losses. The README documents all dataset/representation variants and a pretrained Human3.6M demo. Several entry points and adapters are indexed but not excerpted, so their specific internal call relationships are omitted where the evidence does not establish them.

Main entry points: [`main.py`](https://github.com/wei-mao-2019/learntrajdep/blob/master/main.py) (H36M angle runs), [`utils/data_utils.py`](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/data_utils.py) (Motion data transforms), [`utils/model.py`](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/model.py) (Graph convolution model), [`main_cmu.py`](https://github.com/wei-mao-2019/learntrajdep/blob/master/main_cmu.py) (CMU angle runs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflows["Forecast workflows"]
  node_options["Run options<br/>[opt.py]"]
  node_h36_angle["H36M angle runs<br/>[main.py]"]
  node_h36_3d["H36M 3D runs<br/>[main_3d.py]"]
  node_h36_eval["H36M evaluation<br/>[main_eval.py]"]
  node_h36_3d_eval["H36M 3D evaluation<br/>[main_3d_eval.py]"]
  node_cmu_angle["CMU angle runs<br/>[main_cmu.py]"]
  node_cmu_3d["CMU 3D runs<br/>[main_cmu_3d.py]"]
  node_pw_angle["3DPW angle runs<br/>[main_3dpw.py]"]
  node_pw_3d["3DPW 3D runs<br/>[main_3dpw_3d.py]"]
  node_demo["Pretrained demo<br/>[demo.py]"]
end

subgraph group_datasets["Motion datasets"]
  node_h36_adapter["H36M angle adapter<br/>[h36motion.py]"]
  node_h36_3d_adapter["H36M 3D adapter<br/>[h36motion3d.py]"]
  node_cmu_adapter["CMU angle adapter<br/>[cmu_motion.py]"]
  node_cmu_3d_adapter["CMU 3D adapter<br/>[cmu_motion_3d.py]"]
  node_pw_adapter["3DPW angle adapter<br/>[pose3dpw.py]"]
  node_pw_3d_adapter["3DPW 3D adapter<br/>[pose3dpw3d.py]"]
  node_data_utils["Motion data transforms<br/>[data_utils.py]"]
end

subgraph group_core["Model and evaluation"]
  node_model["Graph convolution model<br/>[model.py]"]
  node_loss["Forecast losses<br/>[loss_funcs.py]"]
  node_kinematics["Forward kinematics"]
end

subgraph group_outputs["Prediction outputs"]
  node_checkpoints[("Model checkpoints<br/>[utils.py]")]
  node_visualization["Pose visualization<br/>[viz.py]"]
end

node_researcher(("Researcher"))
node_h36_data[("Human3.6M")]
node_cmu_data[("CMU mocap")]
node_pw_data[("3DPW")]

node_researcher -->|"trains"| node_h36_angle
node_researcher -->|"trains"| node_h36_3d
node_researcher -->|"trains"| node_cmu_angle
node_researcher -->|"trains"| node_cmu_3d
node_researcher -->|"trains"| node_pw_angle
node_researcher -->|"trains"| node_pw_3d
node_researcher -->|"runs demo"| node_demo
node_h36_data -->|"provides sequences"| node_h36_adapter
node_cmu_data -->|"provides sequences"| node_cmu_adapter
node_pw_data -->|"provides sequences"| node_pw_adapter
node_h36_angle -->|"loads data"| node_h36_adapter
node_h36_3d -->|"loads data"| node_h36_3d_adapter
node_h36_eval -->|"loads data"| node_h36_adapter
node_h36_3d_eval -->|"loads data"| node_h36_3d_adapter
node_cmu_angle -->|"loads data"| node_cmu_adapter
node_cmu_3d -->|"loads data"| node_cmu_3d_adapter
node_pw_angle -->|"loads data"| node_pw_adapter
node_pw_3d -->|"loads data"| node_pw_3d_adapter
node_h36_adapter -->|"prepares sequences"| node_data_utils
node_h36_3d_adapter -->|"uses transforms"| node_data_utils
node_cmu_adapter -->|"uses transforms"| node_data_utils
node_cmu_3d_adapter -->|"uses transforms"| node_data_utils
node_pw_adapter -->|"uses transforms"| node_data_utils
node_pw_3d_adapter -->|"uses transforms"| node_data_utils
node_h36_angle -.->|"runs model"| node_model
node_h36_angle -.->|"computes loss"| node_loss
node_h36_angle -->|"parses options"| node_options
node_h36_angle -->|"saves checkpoints"| node_checkpoints
node_cmu_angle -.->|"runs model"| node_model
node_cmu_angle -.->|"computes loss"| node_loss
node_cmu_3d -.->|"runs model"| node_model
node_pw_angle -.->|"runs model"| node_model
node_pw_3d -.->|"runs model"| node_model
node_demo -.->|"runs model"| node_model
node_loss -->|"converts poses"| node_data_utils
node_visualization -->|"converts poses"| node_kinematics

click node_options "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/opt.py"
click node_h36_angle "https://github.com/wei-mao-2019/learntrajdep/blob/master/main.py"
click node_h36_3d "https://github.com/wei-mao-2019/learntrajdep/blob/master/main_3d.py"
click node_h36_eval "https://github.com/wei-mao-2019/learntrajdep/blob/master/main_eval.py"
click node_h36_3d_eval "https://github.com/wei-mao-2019/learntrajdep/blob/master/main_3d_eval.py"
click node_cmu_angle "https://github.com/wei-mao-2019/learntrajdep/blob/master/main_cmu.py"
click node_cmu_3d "https://github.com/wei-mao-2019/learntrajdep/blob/master/main_cmu_3d.py"
click node_pw_angle "https://github.com/wei-mao-2019/learntrajdep/blob/master/main_3dpw.py"
click node_pw_3d "https://github.com/wei-mao-2019/learntrajdep/blob/master/main_3dpw_3d.py"
click node_demo "https://github.com/wei-mao-2019/learntrajdep/blob/master/demo.py"
click node_h36_adapter "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/h36motion.py"
click node_h36_3d_adapter "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/h36motion3d.py"
click node_cmu_adapter "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/cmu_motion.py"
click node_cmu_3d_adapter "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/cmu_motion_3d.py"
click node_pw_adapter "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/pose3dpw.py"
click node_pw_3d_adapter "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/pose3dpw3d.py"
click node_data_utils "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/data_utils.py"
click node_model "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/model.py"
click node_loss "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/loss_funcs.py"
click node_kinematics "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/forward_kinematics.py"
click node_checkpoints "https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/utils.py"
click node_visualization "https://github.com/wei-mao-2019/learntrajdep/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_options,node_h36_angle,node_h36_3d,node_h36_eval,node_h36_3d_eval,node_cmu_angle,node_cmu_3d,node_pw_angle,node_pw_3d,node_demo toneBlue
class node_h36_adapter,node_h36_3d_adapter,node_cmu_adapter,node_cmu_3d_adapter,node_pw_adapter,node_pw_3d_adapter,node_data_utils,node_h36_data,node_cmu_data,node_pw_data toneAmber
class node_model,node_loss,node_kinematics toneMint
class node_checkpoints,node_visualization toneRose
class node_researcher toneIndigo
```

## Components

### Forecast workflows

- [Run options](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/opt.py): `utils/opt.py`
- [H36M angle runs](https://github.com/wei-mao-2019/learntrajdep/blob/master/main.py): `main.py`
- [H36M 3D runs](https://github.com/wei-mao-2019/learntrajdep/blob/master/main_3d.py): `main_3d.py`
- [H36M evaluation](https://github.com/wei-mao-2019/learntrajdep/blob/master/main_eval.py): `main_eval.py`
- [H36M 3D evaluation](https://github.com/wei-mao-2019/learntrajdep/blob/master/main_3d_eval.py): `main_3d_eval.py`
- [CMU angle runs](https://github.com/wei-mao-2019/learntrajdep/blob/master/main_cmu.py): `main_cmu.py`
- [CMU 3D runs](https://github.com/wei-mao-2019/learntrajdep/blob/master/main_cmu_3d.py): `main_cmu_3d.py`
- [3DPW angle runs](https://github.com/wei-mao-2019/learntrajdep/blob/master/main_3dpw.py): `main_3dpw.py`
- [3DPW 3D runs](https://github.com/wei-mao-2019/learntrajdep/blob/master/main_3dpw_3d.py): `main_3dpw_3d.py`
- [Pretrained demo](https://github.com/wei-mao-2019/learntrajdep/blob/master/demo.py): `demo.py`

### Motion datasets

- [H36M angle adapter](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/h36motion.py): `utils/h36motion.py`
- [H36M 3D adapter](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/h36motion3d.py): `utils/h36motion3d.py`
- [CMU angle adapter](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/cmu_motion.py): `utils/cmu_motion.py`
- [CMU 3D adapter](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/cmu_motion_3d.py): `utils/cmu_motion_3d.py`
- [3DPW angle adapter](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/pose3dpw.py): `utils/pose3dpw.py`
- [3DPW 3D adapter](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/pose3dpw3d.py): `utils/pose3dpw3d.py`
- [Motion data transforms](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/data_utils.py): `utils/data_utils.py`

### Model and evaluation

- [Graph convolution model](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/model.py): `utils/model.py`
- [Forecast losses](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/loss_funcs.py): `utils/loss_funcs.py`
- [Forward kinematics](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/forward_kinematics.py): `utils/forward_kinematics.py`

### Prediction outputs

- [Model checkpoints](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/utils.py): `utils/utils.py`
- [Pose visualization](https://github.com/wei-mao-2019/learntrajdep/blob/master/utils/viz.py): `utils/viz.py`

### Other components

- **Researcher**
- **Human3.6M**
- **CMU mocap**
- **3DPW**

## Connections

- Researcher → H36M angle runs: trains (evidence: `README.md`)
- Researcher → H36M 3D runs: trains (evidence: `README.md`)
- Researcher → CMU angle runs: trains (evidence: `README.md`)
- Researcher → CMU 3D runs: trains (evidence: `README.md`)
- Researcher → 3DPW angle runs: trains (evidence: `README.md`)
- Researcher → 3DPW 3D runs: trains (evidence: `README.md`)
- Researcher → Pretrained demo: runs demo (evidence: `README.md`)
- Human3.6M → H36M angle adapter: provides sequences (evidence: `README.md`)
- CMU mocap → CMU angle adapter: provides sequences (evidence: `README.md`)
- 3DPW → 3DPW angle adapter: provides sequences (evidence: `README.md`)
- H36M angle runs → H36M angle adapter: loads data (evidence: `main.py`)
- H36M 3D runs → H36M 3D adapter: loads data (evidence: `main_3d.py`)
- H36M evaluation → H36M angle adapter: loads data (evidence: `main_eval.py`)
- H36M 3D evaluation → H36M 3D adapter: loads data (evidence: `main_3d_eval.py`)
- CMU angle runs → CMU angle adapter: loads data (evidence: `main_cmu.py`)
- CMU 3D runs → CMU 3D adapter: loads data (evidence: `main_cmu_3d.py`)
- 3DPW angle runs → 3DPW angle adapter: loads data (evidence: `main_3dpw.py`)
- 3DPW 3D runs → 3DPW 3D adapter: loads data (evidence: `main_3dpw_3d.py`)
- H36M angle adapter → Motion data transforms: prepares sequences (evidence: `utils/h36motion.py`)
- H36M 3D adapter → Motion data transforms: uses transforms (evidence: `utils/h36motion3d.py`)
- CMU angle adapter → Motion data transforms: uses transforms (evidence: `utils/cmu_motion.py`)
- CMU 3D adapter → Motion data transforms: uses transforms (evidence: `utils/cmu_motion_3d.py`)
- 3DPW angle adapter → Motion data transforms: uses transforms (evidence: `utils/pose3dpw.py`)
- 3DPW 3D adapter → Motion data transforms: uses transforms (evidence: `utils/pose3dpw3d.py`)
- H36M angle runs → Graph convolution model: runs model (evidence: `main.py`)
- H36M angle runs → Forecast losses: computes loss (evidence: `main.py`)
- H36M angle runs → Run options: parses options (evidence: `main.py`)
- H36M angle runs → Model checkpoints: saves checkpoints (evidence: `main.py`)
- CMU angle runs → Graph convolution model: runs model (evidence: `main_cmu.py`)
- CMU angle runs → Forecast losses: computes loss (evidence: `main_cmu.py`)
- CMU 3D runs → Graph convolution model: runs model (evidence: `main_cmu_3d.py`)
- 3DPW angle runs → Graph convolution model: runs model (evidence: `main_3dpw.py`)
- 3DPW 3D runs → Graph convolution model: runs model (evidence: `main_3dpw_3d.py`)
- Pretrained demo → Graph convolution model: runs model (evidence: `demo.py`)
- Forecast losses → Motion data transforms: converts poses (evidence: `utils/loss_funcs.py`)
- Pose visualization → Forward kinematics: converts poses (evidence: `utils/viz.py`)
