# feceugur/mexecon architecture

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

- Interactive diagram: https://gitdiagram.com/feceugur/mexecon
- Repository: https://github.com/feceugur/mexecon

## Overview

MExECON reconstructs a clothed 3D human avatar from calibrated, sparse RGB views. The documented workflow estimates and jointly optimizes a shared SMPL-X body, predicts front/back normals, integrates partial surfaces, and completes and stitches them into a watertight mesh. The graph combines that documented workflow with relationships visible in the infer.py excerpt and SOURCE INDEX; several capability links are documented rather than verified from implementation excerpts.

Main entry points: [`apps/infer.py`](https://github.com/feceugur/mexecon/blob/main/apps/infer.py) (Reconstruction orchestration), [`lib/pymafx/models/pymaf_net.py`](https://github.com/feceugur/mexecon/blob/main/lib/pymafx/models/pymaf_net.py) (PyMAF-X regression), [`apps/IFGeo.py`](https://github.com/feceugur/mexecon/blob/main/apps/IFGeo.py) (IF-Nets+ completion), [`apps/Normal.py`](https://github.com/feceugur/mexecon/blob/main/apps/Normal.py) (Front/back normal maps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Views and cameras"]
  node_images["Sparse RGB views"]
  node_camera_params["Camera parameters"]
  node_camera_transform["View transforms"]
end

subgraph group_body["Body estimation"]
  node_inference["Reconstruction orchestration<br/>[infer.py]"]
  node_pixie["PIXIE fitting<br/>[pixie.py]"]
  node_pymaf["PyMAF-X regression<br/>[pymaf_net.py]"]
  node_body_model["SMPL-X body model<br/>[body_models.py]"]
  node_joint_opt["Joint body optimization<br/>[infer.py]"]
end

subgraph group_surface["Surface reconstruction"]
  node_normal_maps["Front/back normal maps<br/>[Normal.py]"]
  node_sapiens["Sapiens processing<br/>[sapiens.py]"]
  node_normal_net["Normal prediction network<br/>[NormalNet.py]"]
  node_bni["d-BiNI integration<br/>[BNI.py]"]
  node_bni_utils["Normal integration utilities<br/>[BNI_utils.py]"]
  node_ifgeo["IF-Nets+ completion<br/>[IFGeo.py]"]
  node_ifgeo_net["Implicit geometry networks<br/>[IFGeoNet.py]"]
end

subgraph group_geometry["Geometry foundations"]
  node_lbs["Body deformation<br/>[lbs.py]"]
  node_seg3d["Adaptive 3D sampling<br/>[seg3d_lossless.py]"]
  node_rendering["Rendering utilities<br/>[render_utils.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_image_utils["Image utilities<br/>[imutils.py]"]
  node_training_utils["Network utilities<br/>[train_util.py]"]
  node_pymaf_smpl["PyMAF SMPL support<br/>[smpl.py]"]
  node_transformer_utils["Transformer utilities<br/>[modeling_utils.py]"]
  node_collections["PyMAF collection helpers<br/>[collections.py]"]
  node_pymaf_geometry["PyMAF geometry helpers<br/>[geometry.py]"]
  node_torch_misc["Tensor utilities<br/>[misc.py]"]
end

subgraph group_output["Mesh output and evaluation"]
  node_mesh_tools["Mesh and Poisson tools<br/>[mesh_util.py]"]
  node_evaluation["Reconstruction evaluation"]
end

node_user(("Reconstruction user"))

node_user -->|"runs"| node_inference
node_images -->|"provides views"| node_inference
node_camera_params -->|"provides calibration"| node_inference
node_inference -->|"uses transforms"| node_camera_transform
node_inference -->|"fits views"| node_pixie
node_inference -->|"optimizes body"| node_joint_opt
node_pixie -->|"estimates body"| node_body_model
node_inference -.->|"uses regression"| node_pymaf
node_pymaf -->|"uses body support"| node_pymaf_smpl
node_pymaf_smpl -->|"uses model"| node_body_model
node_body_model -->|"deforms vertices"| node_lbs
node_joint_opt -->|"guides prediction"| node_normal_maps
node_inference -->|"loads predictor"| node_normal_maps
node_normal_maps -->|"uses network"| node_normal_net
node_inference -.->|"optionally uses"| node_sapiens
node_normal_maps -->|"integrates normals"| node_bni
node_inference -->|"invokes integration"| node_bni
node_bni -->|"uses utilities"| node_bni_utils
node_inference -->|"invokes completion"| node_ifgeo
node_ifgeo -->|"uses network"| node_ifgeo_net
node_ifgeo -->|"uses sampling"| node_seg3d
node_bni -.->|"produces surfaces"| node_mesh_tools
node_ifgeo -->|"completes mesh"| node_mesh_tools
node_mesh_tools -.->|"evaluates mesh"| node_evaluation
node_inference -->|"loads settings"| node_config
node_inference -->|"uses image helpers"| node_image_utils
node_ifgeo -->|"uses utilities"| node_training_utils
node_normal_maps -->|"uses utilities"| node_training_utils
node_rendering -->|"uses image helpers"| node_image_utils
node_mesh_tools -->|"uses render helpers"| node_rendering
node_pymaf -->|"uses geometry"| node_pymaf_geometry
node_pymaf -.->|"uses transformers"| node_transformer_utils
node_pymaf -->|"uses helpers"| node_collections
node_transformer_utils -->|"uses tensor helpers"| node_torch_misc

click node_inference "https://github.com/feceugur/mexecon/blob/main/apps/infer.py"
click node_camera_transform "https://github.com/feceugur/mexecon/blob/main/apps/CameraTransformManager.py"
click node_pixie "https://github.com/feceugur/mexecon/blob/main/lib/pixielib/pixie.py"
click node_pymaf "https://github.com/feceugur/mexecon/blob/main/lib/pymafx/models/pymaf_net.py"
click node_body_model "https://github.com/feceugur/mexecon/blob/main/lib/smplx/body_models.py"
click node_lbs "https://github.com/feceugur/mexecon/blob/main/lib/smplx/lbs.py"
click node_joint_opt "https://github.com/feceugur/mexecon/blob/main/apps/infer.py"
click node_normal_maps "https://github.com/feceugur/mexecon/blob/main/apps/Normal.py"
click node_sapiens "https://github.com/feceugur/mexecon/blob/main/apps/sapiens.py"
click node_normal_net "https://github.com/feceugur/mexecon/blob/main/lib/net/NormalNet.py"
click node_bni "https://github.com/feceugur/mexecon/blob/main/lib/common/BNI.py"
click node_bni_utils "https://github.com/feceugur/mexecon/blob/main/lib/common/BNI_utils.py"
click node_ifgeo "https://github.com/feceugur/mexecon/blob/main/apps/IFGeo.py"
click node_ifgeo_net "https://github.com/feceugur/mexecon/blob/main/lib/net/IFGeoNet.py"
click node_seg3d "https://github.com/feceugur/mexecon/blob/main/lib/common/seg3d_lossless.py"
click node_mesh_tools "https://github.com/feceugur/mexecon/blob/main/lib/dataset/mesh_util.py"
click node_rendering "https://github.com/feceugur/mexecon/blob/main/lib/common/render_utils.py"
click node_evaluation "https://github.com/feceugur/mexecon/blob/main/eval/evaluate_methods.py"
click node_config "https://github.com/feceugur/mexecon/blob/main/lib/common/config.py"
click node_image_utils "https://github.com/feceugur/mexecon/blob/main/lib/common/imutils.py"
click node_training_utils "https://github.com/feceugur/mexecon/blob/main/lib/common/train_util.py"
click node_pymaf_smpl "https://github.com/feceugur/mexecon/blob/main/lib/pymafx/models/smpl.py"
click node_transformer_utils "https://github.com/feceugur/mexecon/blob/main/lib/pymafx/models/transformers/bert/modeling_utils.py"
click node_collections "https://github.com/feceugur/mexecon/blob/main/lib/pymafx/utils/collections.py"
click node_pymaf_geometry "https://github.com/feceugur/mexecon/blob/main/lib/pymafx/utils/geometry.py"
click node_torch_misc "https://github.com/feceugur/mexecon/blob/main/lib/torch_utils/misc.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_images,node_camera_params,node_camera_transform,node_user toneBlue
class node_inference,node_pixie,node_pymaf,node_body_model,node_joint_opt toneAmber
class node_normal_maps,node_sapiens,node_normal_net,node_bni,node_bni_utils,node_ifgeo,node_ifgeo_net toneMint
class node_lbs,node_seg3d,node_rendering,node_config,node_image_utils,node_training_utils,node_pymaf_smpl,node_transformer_utils,node_collections,node_pymaf_geometry,node_torch_misc toneRose
class node_mesh_tools,node_evaluation toneIndigo
```

## Components

### Views and cameras

- **Sparse RGB views**
- **Camera parameters**
- [View transforms](https://github.com/feceugur/mexecon/blob/main/apps/CameraTransformManager.py): `apps/CameraTransformManager.py`

### Body estimation

- [Reconstruction orchestration](https://github.com/feceugur/mexecon/blob/main/apps/infer.py): `apps/infer.py`
- [PIXIE fitting](https://github.com/feceugur/mexecon/blob/main/lib/pixielib/pixie.py): `lib/pixielib/pixie.py`
- [PyMAF-X regression](https://github.com/feceugur/mexecon/blob/main/lib/pymafx/models/pymaf_net.py): `lib/pymafx/models/pymaf_net.py`
- [SMPL-X body model](https://github.com/feceugur/mexecon/blob/main/lib/smplx/body_models.py): `lib/smplx/body_models.py`
- [Joint body optimization](https://github.com/feceugur/mexecon/blob/main/apps/infer.py): `apps/infer.py`

### Surface reconstruction

- [Front/back normal maps](https://github.com/feceugur/mexecon/blob/main/apps/Normal.py): `apps/Normal.py`
- [Sapiens processing](https://github.com/feceugur/mexecon/blob/main/apps/sapiens.py): `apps/sapiens.py`
- [Normal prediction network](https://github.com/feceugur/mexecon/blob/main/lib/net/NormalNet.py): `lib/net/NormalNet.py`
- [d-BiNI integration](https://github.com/feceugur/mexecon/blob/main/lib/common/BNI.py): `lib/common/BNI.py`
- [Normal integration utilities](https://github.com/feceugur/mexecon/blob/main/lib/common/BNI_utils.py): `lib/common/BNI_utils.py`
- [IF-Nets+ completion](https://github.com/feceugur/mexecon/blob/main/apps/IFGeo.py): `apps/IFGeo.py`
- [Implicit geometry networks](https://github.com/feceugur/mexecon/blob/main/lib/net/IFGeoNet.py): `lib/net/IFGeoNet.py`

### Geometry foundations

- [Body deformation](https://github.com/feceugur/mexecon/blob/main/lib/smplx/lbs.py): `lib/smplx/lbs.py`
- [Adaptive 3D sampling](https://github.com/feceugur/mexecon/blob/main/lib/common/seg3d_lossless.py): `lib/common/seg3d_lossless.py`
- [Rendering utilities](https://github.com/feceugur/mexecon/blob/main/lib/common/render_utils.py): `lib/common/render_utils.py`
- [Runtime configuration](https://github.com/feceugur/mexecon/blob/main/lib/common/config.py): `lib/common/config.py`
- [Image utilities](https://github.com/feceugur/mexecon/blob/main/lib/common/imutils.py): `lib/common/imutils.py`
- [Network utilities](https://github.com/feceugur/mexecon/blob/main/lib/common/train_util.py): `lib/common/train_util.py`
- [PyMAF SMPL support](https://github.com/feceugur/mexecon/blob/main/lib/pymafx/models/smpl.py): `lib/pymafx/models/smpl.py`
- [Transformer utilities](https://github.com/feceugur/mexecon/blob/main/lib/pymafx/models/transformers/bert/modeling_utils.py): `lib/pymafx/models/transformers/bert/modeling_utils.py`
- [PyMAF collection helpers](https://github.com/feceugur/mexecon/blob/main/lib/pymafx/utils/collections.py): `lib/pymafx/utils/collections.py`
- [PyMAF geometry helpers](https://github.com/feceugur/mexecon/blob/main/lib/pymafx/utils/geometry.py): `lib/pymafx/utils/geometry.py`
- [Tensor utilities](https://github.com/feceugur/mexecon/blob/main/lib/torch_utils/misc.py): `lib/torch_utils/misc.py`

### Mesh output and evaluation

- [Mesh and Poisson tools](https://github.com/feceugur/mexecon/blob/main/lib/dataset/mesh_util.py): `lib/dataset/mesh_util.py`
- [Reconstruction evaluation](https://github.com/feceugur/mexecon/blob/main/eval/evaluate_methods.py): `eval/evaluate_methods.py`

### Other components

- **Reconstruction user**

## Connections

- Reconstruction user → Reconstruction orchestration: runs (evidence: `README.md`)
- Sparse RGB views → Reconstruction orchestration: provides views (evidence: `README.md`)
- Camera parameters → Reconstruction orchestration: provides calibration (evidence: `README.md`)
- Reconstruction orchestration → View transforms: uses transforms (evidence: `apps/infer.py`)
- Reconstruction orchestration → PIXIE fitting: fits views (evidence: `README.md`)
- Reconstruction orchestration → Joint body optimization: optimizes body (evidence: `apps/infer.py`)
- PIXIE fitting → SMPL-X body model: estimates body (evidence: `lib/pixielib/pixie.py`)
- Reconstruction orchestration → PyMAF-X regression: uses regression
- PyMAF-X regression → PyMAF SMPL support: uses body support (evidence: `lib/pymafx/models/pymaf_net.py`)
- PyMAF SMPL support → SMPL-X body model: uses model (evidence: `lib/pymafx/models/smpl.py`)
- SMPL-X body model → Body deformation: deforms vertices (evidence: `lib/smplx/lbs.py`)
- Joint body optimization → Front/back normal maps: guides prediction (evidence: `README.md`)
- Reconstruction orchestration → Front/back normal maps: loads predictor (evidence: `apps/infer.py`)
- Front/back normal maps → Normal prediction network: uses network (evidence: `apps/Normal.py`)
- Reconstruction orchestration → Sapiens processing: optionally uses (evidence: `apps/infer.py`)
- Front/back normal maps → d-BiNI integration: integrates normals (evidence: `README.md`)
- Reconstruction orchestration → d-BiNI integration: invokes integration (evidence: `apps/infer.py`)
- d-BiNI integration → Normal integration utilities: uses utilities (evidence: `lib/common/BNI.py`)
- Reconstruction orchestration → IF-Nets+ completion: invokes completion (evidence: `apps/infer.py`)
- IF-Nets+ completion → Implicit geometry networks: uses network (evidence: `apps/IFGeo.py`)
- IF-Nets+ completion → Adaptive 3D sampling: uses sampling (evidence: `apps/IFGeo.py`)
- d-BiNI integration → Mesh and Poisson tools: produces surfaces
- IF-Nets+ completion → Mesh and Poisson tools: completes mesh (evidence: `README.md`)
- Mesh and Poisson tools → Reconstruction evaluation: evaluates mesh
- Reconstruction orchestration → Runtime configuration: loads settings (evidence: `apps/infer.py`)
- Reconstruction orchestration → Image utilities: uses image helpers (evidence: `apps/infer.py`)
- IF-Nets+ completion → Network utilities: uses utilities (evidence: `apps/IFGeo.py`)
- Front/back normal maps → Network utilities: uses utilities (evidence: `apps/Normal.py`)
- Rendering utilities → Image utilities: uses image helpers (evidence: `lib/common/render.py`)
- Mesh and Poisson tools → Rendering utilities: uses render helpers (evidence: `lib/dataset/mesh_util.py`)
- PyMAF-X regression → PyMAF geometry helpers: uses geometry (evidence: `lib/pymafx/models/pymaf_net.py`)
- PyMAF-X regression → Transformer utilities: uses transformers
- PyMAF-X regression → PyMAF collection helpers: uses helpers (evidence: `lib/pymafx/models/pymaf_net.py`)
- Transformer utilities → Tensor utilities: uses tensor helpers
