# cedricrommel/manipose architecture

> Architecture diagram of the GitHub repository cedricrommel/manipose, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cedricrommel/manipose
- Repository: https://github.com/cedricrommel/manipose

## Overview

##### Main Components
- Configuration & Setup:
– YAML configuration files in “hpe/conf” and “toy_experiment/conf” that contain settings for training, model parameters, and data paths.
– Global configuration management via command-line overrides.
- Data Handling:
– “hpe/conf/data” and “toy_experiment/conf/data” hold dataset configuration (e.g., MPI-INF-3DHP, Human3.6M, and toy experimental setups).
– Data processing and generator modules in “hpe/mh_so3_hpe/data” (e.g., dataset loaders, camera models, skeleton utilities).
- Model Architectures:
– The core model implementations reside mainly in the “hpe/mh_so3_hpe/architectures” folder. This includes several variants (e.g., manifold_mix_ste, mix_ste, rmcl_manifold_mix_ste) and supporting utilities like forward kinematics and rotation tools.
– Additional models for toy experiments are available in “toy_experiment/models”, indicating a variant or simplified version of the full pipeline.
- Training & Evaluation Pipeline:
– Main scripts in “hpe/main_h36m_lifting.py” and “hpe/main_3dhp.py” handle training and evaluation for different datasets.
– The “toy_experiment/training” subdirectory contains training utilities (e.g., trainer, metrics, experimental averaging).
– Auxiliary scripts in “hpe/useful_aux_scripts” support parameter counting, baseline evaluation, and other diagnostics.
- Metrics & Visualization:
– Dedicated modules for computing losses and pose error metrics found in “hpe/mh_so3_hpe/metrics”.
– Visualization scripts like “viz.py” and utility modules in “hpe/mh_so3_hpe/visualization” are used to generate qualitative results (e.g., generating videos or GIFs of predicted poses).
- Experimentation and Auxiliary Components:
– The “toy_experiment” directory houses scripts for toy experiments (e.g., “plotting_script.py”, “toy-plot.py”, and quantitative comparison shell scripts).
– File assets like images and plots (e.g., in “assets”, “toy_experiment/images”) are used for qualitative analysis and result presentation.

##### Relationships and Interactions
- The Configuration layer initializes the system by loading settings for datasets, training, and model hyperparameters.
- Data Handling modules ingest the raw data from datasets and pass it (after augmentation or transformation) to the model.
- The Model Architectures take these processed inputs to perform the 2D-to-3D lifting, generating multiple pose hypotheses with manifold constraints.
- A Training Engine (via main scripts and training utilities) coordinates data input, model forward passes, loss computation through metrics modules, and backpropagation.
- Post-training, evaluation and visualization scripts process outputs to assess performance and generate visual results.
- Auxiliary scripts support experiment reproducibility, diagnostics, and parameter introspection.

##### Architectural Patterns and Design Principles
- Modular Design: The code is split into clear domains (data, models, training, and visualization), with each directory corresponding to a functional module.
- Multi-Hypothesis Output: The system’s design emphasizes generating multiple candidate 3D poses to handle depth ambiguity.
- Manifold Constraints: Specialized architecture modules (e.g., manifold_mix_ste, rotation_tools) ensure that predictions lie on the human pose manifold.
- Reusability: Common utilities (found across “utils”, “metrics”, “augmentations”) are shared across both full-scale experiments and toy experiments, showcasing separation of concerns.

##### Relevant Technologies and Frameworks
- Python 3.7+ is required.
- External libraries as defined in “requirements.txt” (e.g., PyTorch or TensorFlow may be used implicitly, though specifics should be verified from the requirements).
- The project also supports integration with MLFlow for experiment tracking.
- The project borrows baseline ideas from repositories such as DiffHPE, AnyGCN, SemGCN, and VideoPose3D, so it reflects best practices from those implementations.

##### Final Advice
- Be as detailed as possible, ensuring that every module from data input to visualization is captured.
- Interconnections — such as how alterations in YAML configurations impact both training and evaluation.
- Experimental and auxiliary parts since these are essential to reproducing the results showcased in the paper.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Configuration Management
    subgraph "Configuration Management"
        Config_HPE["HPE Config"]
        Config_Toy["Toy Exp Config"]
    end

    %% Data Handling Layer
    subgraph "Data Handling Layer"
        Data_HPE["HPE Data Handling"]
        Data_Toy["Toy Exp Data Handling"]
    end

    %% Model Architectures
    subgraph "Model Architectures"
        Arch_HPE["HPE Model Architectures"]
        Arch_Toy["Toy Experiment Models"]
    end

    %% Training Engine
    subgraph "Training Engine"
        Train_H36M["Main H36M Lifting"]
        Train_3DHP["Main 3DHP"]
        Train_Toy["Toy Experiment Training"]
    end

    %% Evaluation & Visualization
    subgraph "Evaluation & Visualization"
        Metrics_HPE["HPE Metrics"]
        Viz_HPE["HPE Visualization"]
    end

    %% Auxiliary Components
    subgraph "Auxiliary Components"
        Aux_HPE["HPE Auxiliary Scripts"]
        Aux_Toy["Toy Experiment Aux Scripts"]
    end

    %% Connections from Configuration to Data Handling
    Config_HPE -->|"loads"| Data_HPE
    Config_Toy -->|"loads"| Data_Toy

    %% Data flows into Model Architectures
    Data_HPE -->|"processes"| Arch_HPE
    Data_Toy -->|"processes"| Arch_Toy

    %% Models feed into Training pipelines
    Arch_HPE -->|"triggers"| Train_H36M
    Arch_HPE -->|"triggers"| Train_3DHP
    Arch_Toy -->|"triggers"| Train_Toy

    %% Training outcomes flow into Evaluation & Viz
    Train_H36M -->|"evaluates"| Metrics_HPE
    Train_H36M -->|"visualizes"| Viz_HPE
    Train_3DHP -->|"evaluates"| Metrics_HPE
    Train_3DHP -->|"visualizes"| Viz_HPE
    Train_Toy -->|"evaluates"| Metrics_HPE
    Train_Toy -->|"visualizes"| Viz_HPE

    %% Training pipelines utilize Auxiliary scripts
    Train_H36M -->|"aids"| Aux_HPE
    Train_3DHP -->|"aids"| Aux_HPE
    Train_Toy -->|"aids"| Aux_Toy

    %% Styles
    classDef config fill:#ffcc00,stroke:#000,stroke-width:2px;
    classDef data fill:#99ccff,stroke:#000,stroke-width:2px;
    classDef model fill:#ccffcc,stroke:#000,stroke-width:2px;
    classDef training fill:#ff9999,stroke:#000,stroke-width:2px;
    classDef eval fill:#ffccff,stroke:#000,stroke-width:2px;
    classDef aux fill:#cccccc,stroke:#000,stroke-width:2px;

    class Config_HPE,Config_Toy config;
    class Data_HPE,Data_Toy data;
    class Arch_HPE,Arch_Toy model;
    class Train_H36M,Train_3DHP,Train_Toy training;
    class Metrics_HPE,Viz_HPE eval;
    class Aux_HPE,Aux_Toy aux;

    %% Click Events
    click Config_HPE "https://github.com/cedricrommel/manipose/tree/main/hpe/conf"
    click Config_Toy "https://github.com/cedricrommel/manipose/tree/main/toy_experiment/conf"
    click Data_HPE "https://github.com/cedricrommel/manipose/tree/main/hpe/mh_so3_hpe/data"
    click Data_Toy "https://github.com/cedricrommel/manipose/tree/main/toy_experiment/data"
    click Arch_HPE "https://github.com/cedricrommel/manipose/tree/main/hpe/mh_so3_hpe/architectures"
    click Arch_Toy "https://github.com/cedricrommel/manipose/tree/main/toy_experiment/models"
    click Train_H36M "https://github.com/cedricrommel/manipose/blob/main/hpe/main_h36m_lifting.py"
    click Train_3DHP "https://github.com/cedricrommel/manipose/blob/main/hpe/main_3dhp.py"
    click Train_Toy "https://github.com/cedricrommel/manipose/tree/main/toy_experiment/training"
    click Metrics_HPE "https://github.com/cedricrommel/manipose/tree/main/hpe/mh_so3_hpe/metrics"
    click Viz_HPE "https://github.com/cedricrommel/manipose/tree/main/hpe/mh_so3_hpe/visualization"
    click Aux_HPE "https://github.com/cedricrommel/manipose/tree/main/hpe/useful_aux_scripts"
    click Aux_Toy "https://github.com/cedricrommel/manipose/tree/main/toy_experiment"
```
