# m-i-c-h-e-a-l-05/2d_to_3d_human architecture

> Architecture diagram of the GitHub repository m-i-c-h-e-a-l-05/2d_to_3d_human, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/m-i-c-h-e-a-l-05/2d_to_3d_human
- Repository: https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human

## Overview

This is a Python human-image-to-3D reconstruction application, with a separate multi-angle capture workflow. In the reconstruction path, a source image is cropped around the person, segmented, split into overlapping upper/lower regions, depth-estimated and aligned, then reconstructed and saved as an OBJ. The main script also prepares and displays intermediate results. CaptureManager and PoseDetector support angle-guided frame collection, but the excerpts do not show them wired into main. Edges follow explicit calls in main or component behavior; the segmentation-to-depth-model link is unverified.

Main entry points: [`main.py`](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/main.py) (Reconstruction Runner), [`zoe_depth_model.py`](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/zoe_depth_model.py) (Zoe Depth Model), [`human_segmenter.py`](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/human_segmenter.py) (Human Segmenter), [`depth_estimator.py`](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/depth_estimator.py) (Depth Estimator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Angle Capture"]
  node_pose["Pose Detector<br/>[pose_detector.py]"]
  node_capture_manager["Capture Manager<br/>[capture_manager.py]"]
end

subgraph group_preprocess["Image Preparation"]
  node_main["Reconstruction Runner<br/>[main.py]"]
  node_cropper["Person Cropper<br/>[person_cropper.py]"]
  node_segmenter["Human Segmenter<br/>[human_segmenter.py]"]
  node_splitter["Body Splitter<br/>[mask_splitter.py]"]
end

subgraph group_depth["Depth Processing"]
  node_zoe["Zoe Depth Model<br/>[zoe_depth_model.py]"]
  node_depth_estimator["Depth Estimator<br/>[depth_estimator.py]"]
  node_aligner["Depth Aligner<br/>[depth_aligner.py]"]
end

subgraph group_output["3D Output"]
  node_reconstructor["Mesh Reconstructor"]
  node_obj_file["OBJ File"]
end

node_operator(("Image Provider"))
node_depth_source["ZoeDepth Source"]

node_operator -->|"provides image"| node_main
node_main -->|"calls crop"| node_cropper
node_main -->|"calls segmentation"| node_segmenter
node_main -->|"splits body"| node_splitter
node_main -->|"estimates depth"| node_depth_estimator
node_main -->|"aligns depth"| node_aligner
node_main -->|"reconstructs mesh"| node_reconstructor
node_depth_estimator -->|"requests inference"| node_zoe
node_zoe -->|"loads model"| node_depth_source
node_segmenter -.->|"uses depth model"| node_zoe
node_reconstructor -->|"writes OBJ"| node_obj_file
node_operator -.->|"supplies frames"| node_pose
node_operator -.->|"supplies frames"| node_capture_manager

click node_main "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/main.py"
click node_cropper "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/person_cropper.py"
click node_segmenter "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/human_segmenter.py"
click node_splitter "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/mask_splitter.py"
click node_zoe "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/zoe_depth_model.py"
click node_depth_estimator "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/depth_estimator.py"
click node_aligner "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/depth_aligner.py"
click node_reconstructor "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/obj_reconstructor.py"
click node_pose "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/pose_detector.py"
click node_capture_manager "https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/capture_manager.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_pose,node_capture_manager toneBlue
class node_main,node_cropper,node_segmenter,node_splitter toneAmber
class node_zoe,node_depth_estimator,node_aligner toneMint
class node_reconstructor,node_obj_file toneRose
class node_operator,node_depth_source toneIndigo
```

## Components

### Angle Capture

- [Pose Detector](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/pose_detector.py): `pose_detector.py`
- [Capture Manager](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/capture_manager.py): `capture_manager.py`

### Image Preparation

- [Reconstruction Runner](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/main.py): `main.py`
- [Person Cropper](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/person_cropper.py): `person_cropper.py`
- [Human Segmenter](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/human_segmenter.py): `human_segmenter.py`
- [Body Splitter](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/mask_splitter.py): `mask_splitter.py`

### Depth Processing

- [Zoe Depth Model](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/zoe_depth_model.py): `zoe_depth_model.py`
- [Depth Estimator](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/depth_estimator.py): `depth_estimator.py`
- [Depth Aligner](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/depth_aligner.py): `depth_aligner.py`

### 3D Output

- [Mesh Reconstructor](https://github.com/m-i-c-h-e-a-l-05/2d_to_3d_human/blob/main/obj_reconstructor.py): `obj_reconstructor.py`
- **OBJ File**

### Other components

- **Image Provider**
- **ZoeDepth Source**

## Connections

- Image Provider → Reconstruction Runner: provides image (evidence: `main.py`)
- Reconstruction Runner → Person Cropper: calls crop (evidence: `main.py`)
- Reconstruction Runner → Human Segmenter: calls segmentation (evidence: `main.py`)
- Reconstruction Runner → Body Splitter: splits body (evidence: `main.py`)
- Reconstruction Runner → Depth Estimator: estimates depth (evidence: `main.py`)
- Reconstruction Runner → Depth Aligner: aligns depth (evidence: `main.py`)
- Reconstruction Runner → Mesh Reconstructor: reconstructs mesh (evidence: `main.py`)
- Depth Estimator → Zoe Depth Model: requests inference (evidence: `depth_estimator.py`)
- Zoe Depth Model → ZoeDepth Source: loads model (evidence: `zoe_depth_model.py`)
- Human Segmenter → Zoe Depth Model: uses depth model
- Mesh Reconstructor → OBJ File: writes OBJ (evidence: `obj_reconstructor.py`)
- Image Provider → Pose Detector: supplies frames
- Image Provider → Capture Manager: supplies frames
