# gargi-09/depthar architecture

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

- Interactive diagram: https://gitdiagram.com/gargi-09/depthar
- Repository: https://github.com/gargi-09/depthar

## Overview

DepthAR is a webcam AR application that estimates depth and person semantics, corrects foreground boundaries, stabilizes depth over time, and renders virtual overlays. The README documents a four-stage frame pipeline; the sampled sources implement its vision and rendering components, but the runtime orchestrator is not shown (api/main.py is empty in the excerpt). Accordingly, pipeline links rely on README evidence, and the separate face-reticle and exosuit features are shown without guessed wiring.

Main entry points: [`scripts`](https://github.com/gargi-09/depthar/tree/main/scripts) (Frame workflow), [`core/occlusion_reasoner.py`](https://github.com/gargi-09/depthar/blob/main/core/occlusion_reasoner.py) (Boundary correction), [`ar/renderer.py`](https://github.com/gargi-09/depthar/blob/main/ar/renderer.py) (Occlusion renderer), [`core/depth_estimator.py`](https://github.com/gargi-09/depthar/blob/main/core/depth_estimator.py) (Depth estimation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Vision inference"]
  node_depth["Depth estimation<br/>[depth_estimator.py]"]
  node_segmentation["Person segmentation<br/>[segmentor.py]"]
end

subgraph group_fusion["Mask and stability"]
  node_reasoner["Boundary correction"]
  node_smoother["Temporal smoothing"]
end

subgraph group_ar["AR rendering"]
  node_renderer["Occlusion renderer<br/>[renderer.py]"]
  node_reticle["Face reticle<br/>[face_anchor.py]"]
  node_exosuit["Exosuit overlay<br/>[exosuit.py]"]
end

subgraph group_entry["Runtime entry"]
  node_runtime["Frame workflow"]
end

node_person(("Webcam user"))

node_person -->|"provides frames"| node_runtime
node_runtime -->|"estimates depth"| node_depth
node_runtime -->|"segments person"| node_segmentation
node_depth -->|"provides depth"| node_reasoner
node_segmentation -->|"provides mask"| node_reasoner
node_reasoner -->|"corrects boundaries"| node_smoother
node_smoother -.->|"stabilizes depth"| node_renderer
node_reasoner -->|"provides occlusion mask"| node_renderer
node_runtime -.->|"renders overlay"| node_renderer

click node_depth "https://github.com/gargi-09/depthar/blob/main/core/depth_estimator.py"
click node_segmentation "https://github.com/gargi-09/depthar/blob/main/core/segmentor.py"
click node_reasoner "https://github.com/gargi-09/depthar/blob/main/core/occlusion_reasoner.py"
click node_smoother "https://github.com/gargi-09/depthar/blob/main/core/temporal_smoother.py"
click node_renderer "https://github.com/gargi-09/depthar/blob/main/ar/renderer.py"
click node_reticle "https://github.com/gargi-09/depthar/blob/main/ar/face_anchor.py"
click node_exosuit "https://github.com/gargi-09/depthar/blob/main/ar/exosuit.py"
click node_runtime "https://github.com/gargi-09/depthar/tree/main/scripts"

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_depth,node_segmentation,node_person toneBlue
class node_reasoner,node_smoother toneAmber
class node_renderer,node_reticle,node_exosuit toneMint
class node_runtime toneRose
```

## Components

### Vision inference

- [Depth estimation](https://github.com/gargi-09/depthar/blob/main/core/depth_estimator.py): `core/depth_estimator.py`
- [Person segmentation](https://github.com/gargi-09/depthar/blob/main/core/segmentor.py): `core/segmentor.py`

### Mask and stability

- [Boundary correction](https://github.com/gargi-09/depthar/blob/main/core/occlusion_reasoner.py): `core/occlusion_reasoner.py`
- [Temporal smoothing](https://github.com/gargi-09/depthar/blob/main/core/temporal_smoother.py): `core/temporal_smoother.py`

### AR rendering

- [Occlusion renderer](https://github.com/gargi-09/depthar/blob/main/ar/renderer.py): `ar/renderer.py`
- [Face reticle](https://github.com/gargi-09/depthar/blob/main/ar/face_anchor.py): `ar/face_anchor.py`
- [Exosuit overlay](https://github.com/gargi-09/depthar/blob/main/ar/exosuit.py): `ar/exosuit.py`

### Runtime entry

- [Frame workflow](https://github.com/gargi-09/depthar/tree/main/scripts): `scripts`

### Other components

- **Webcam user**

## Connections

- Webcam user → Frame workflow: provides frames (evidence: `README.md`)
- Frame workflow → Depth estimation: estimates depth (evidence: `README.md`)
- Frame workflow → Person segmentation: segments person (evidence: `README.md`)
- Depth estimation → Boundary correction: provides depth (evidence: `README.md`)
- Person segmentation → Boundary correction: provides mask (evidence: `README.md`)
- Boundary correction → Temporal smoothing: corrects boundaries (evidence: `README.md`)
- Temporal smoothing → Occlusion renderer: stabilizes depth
- Boundary correction → Occlusion renderer: provides occlusion mask (evidence: `ar/renderer.py`)
- Frame workflow → Occlusion renderer: renders overlay
