# abhibagul/openreco architecture

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

- Interactive diagram: https://gitdiagram.com/abhibagul/openreco
- Repository: https://github.com/abhibagul/openreco

## Overview

OpenReco is a photogrammetry and 3D reconstruction platform. Its main workflow takes aerial photos through image ingest, SfM, georeferencing, dense reconstruction, surface products, and export to GIS and 3D-viewer formats. Projects are described by a manifest and executed by a shared DAG engine with caching; users can start runs through the CLI, Python API, or local UI. The README documents the major product stages and outputs; some stage links below rely on that documentation because their implementations were not sampled.

Main entry points: [`openreco/engine/runner.py`](https://github.com/abhibagul/openreco/blob/main/openreco/engine/runner.py) (DAG runner), [`openreco/stages`](https://github.com/abhibagul/openreco/tree/main/openreco/stages) (DSM and DTM), [`openreco/api.py`](https://github.com/abhibagul/openreco/blob/main/openreco/api.py) (Python API), [`openreco/ui/server.py`](https://github.com/abhibagul/openreco/blob/main/openreco/ui/server.py) (Local UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["CLI<br/>[cli.py]"]
  node_python_api["Python API<br/>[api.py]"]
  node_local_ui["Local UI<br/>[server.py]"]
end

subgraph group_engine["Project and runtime"]
  node_manifest["Project manifest<br/>[manifest.py]"]
  node_workflow["Workflow mapping<br/>[workflow.py]"]
  node_runner["DAG runner<br/>[runner.py]"]
  node_stage_runtime["Stage runtime<br/>[stage.py]"]
  node_cache[("Content cache<br/>[cache.py]")]
  node_run_context["Run context<br/>[context.py]"]
end

subgraph group_reconstruction["Reconstruction pipeline"]
  node_ingest["Photo ingest<br/>[ingest.py]"]
  node_sfm["SfM alignment<br/>[sfm.py]"]
  node_georef["Georeferencing<br/>[georef.py]"]
  node_mvs["Dense reconstruction<br/>[mvs.py]"]
  node_mesh_texture["Mesh and texture"]
end

subgraph group_products["Mapping products"]
  node_surface_models["DSM and DTM"]
  node_mapping_products["Contours and coverage"]
end

subgraph group_delivery["Outputs and analysis"]
  node_export_stage["Pipeline export<br/>[export.py]"]
  node_exporters["Format exporters<br/>[exporters.py]"]
  node_raster_io["Raster I/O<br/>[raster.py]"]
  node_pointcloud_io["Point-cloud I/O<br/>[pointcloud.py]"]
  node_measurement["Survey measurements<br/>[measure.py]"]
  node_report["Run report<br/>[report.py]"]
  node_viewer["3D web viewer"]
end

node_user(("Project user"))

node_user -->|"starts run"| node_cli
node_user -->|"scripts run"| node_python_api
node_user -->|"operates project"| node_local_ui
node_cli -->|"runs pipeline"| node_runner
node_python_api -->|"runs pipeline"| node_runner
node_local_ui -->|"starts runs"| node_runner
node_local_ui -->|"configures stages"| node_workflow
node_python_api -->|"loads project"| node_manifest
node_runner -->|"reads stages"| node_manifest
node_runner -->|"dispatches stages"| node_stage_runtime
node_runner -->|"checks and writes"| node_cache
node_runner -->|"provides context"| node_run_context
node_stage_runtime -->|"accepts context"| node_run_context
node_ingest -->|"supplies photos"| node_sfm
node_sfm -->|"supplies model"| node_georef
node_georef -->|"supplies georeference"| node_mvs
node_mvs -->|"supplies dense cloud"| node_mesh_texture
node_mesh_texture -->|"supplies geometry"| node_surface_models
node_surface_models -->|"generates map products"| node_mapping_products
node_mapping_products -->|"feeds export"| node_export_stage
node_export_stage -->|"converts products"| node_exporters
node_exporters -->|"writes clouds"| node_pointcloud_io
node_exporters -->|"writes rasters"| node_raster_io
node_surface_models -->|"writes GeoTIFF"| node_raster_io
node_surface_models -->|"supports analysis"| node_measurement
node_runner -->|"records run"| node_report
node_export_stage -->|"builds viewer output"| node_viewer

click node_cli "https://github.com/abhibagul/openreco/blob/main/openreco/cli.py"
click node_python_api "https://github.com/abhibagul/openreco/blob/main/openreco/api.py"
click node_local_ui "https://github.com/abhibagul/openreco/blob/main/openreco/ui/server.py"
click node_manifest "https://github.com/abhibagul/openreco/blob/main/openreco/engine/manifest.py"
click node_workflow "https://github.com/abhibagul/openreco/blob/main/openreco/workflow.py"
click node_runner "https://github.com/abhibagul/openreco/blob/main/openreco/engine/runner.py"
click node_stage_runtime "https://github.com/abhibagul/openreco/blob/main/openreco/engine/stage.py"
click node_cache "https://github.com/abhibagul/openreco/blob/main/openreco/engine/cache.py"
click node_run_context "https://github.com/abhibagul/openreco/blob/main/openreco/engine/context.py"
click node_ingest "https://github.com/abhibagul/openreco/blob/main/openreco/stages/ingest.py"
click node_sfm "https://github.com/abhibagul/openreco/blob/main/openreco/stages/sfm.py"
click node_georef "https://github.com/abhibagul/openreco/blob/main/openreco/stages/georef.py"
click node_mvs "https://github.com/abhibagul/openreco/blob/main/openreco/stages/mvs.py"
click node_mesh_texture "https://github.com/abhibagul/openreco/tree/main/openreco/stages"
click node_surface_models "https://github.com/abhibagul/openreco/tree/main/openreco/stages"
click node_mapping_products "https://github.com/abhibagul/openreco/tree/main/openreco/stages"
click node_export_stage "https://github.com/abhibagul/openreco/blob/main/openreco/stages/export.py"
click node_exporters "https://github.com/abhibagul/openreco/blob/main/openreco/exporters.py"
click node_raster_io "https://github.com/abhibagul/openreco/blob/main/openreco/io/raster.py"
click node_pointcloud_io "https://github.com/abhibagul/openreco/blob/main/openreco/io/pointcloud.py"
click node_measurement "https://github.com/abhibagul/openreco/blob/main/openreco/measure.py"
click node_report "https://github.com/abhibagul/openreco/blob/main/openreco/engine/report.py"
click node_viewer "https://github.com/abhibagul/openreco/tree/main/openreco/viewer"

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_cli,node_python_api,node_local_ui,node_user toneBlue
class node_manifest,node_workflow,node_runner,node_stage_runtime,node_cache,node_run_context toneAmber
class node_ingest,node_sfm,node_georef,node_mvs,node_mesh_texture toneMint
class node_surface_models,node_mapping_products toneRose
class node_export_stage,node_exporters,node_raster_io,node_pointcloud_io,node_measurement,node_report,node_viewer toneIndigo
```

## Components

### User entry points

- [CLI](https://github.com/abhibagul/openreco/blob/main/openreco/cli.py): `openreco/cli.py`
- [Python API](https://github.com/abhibagul/openreco/blob/main/openreco/api.py): `openreco/api.py`
- [Local UI](https://github.com/abhibagul/openreco/blob/main/openreco/ui/server.py): `openreco/ui/server.py`

### Project and runtime

- [Project manifest](https://github.com/abhibagul/openreco/blob/main/openreco/engine/manifest.py): `openreco/engine/manifest.py`
- [Workflow mapping](https://github.com/abhibagul/openreco/blob/main/openreco/workflow.py): `openreco/workflow.py`
- [DAG runner](https://github.com/abhibagul/openreco/blob/main/openreco/engine/runner.py): `openreco/engine/runner.py`
- [Stage runtime](https://github.com/abhibagul/openreco/blob/main/openreco/engine/stage.py): `openreco/engine/stage.py`
- [Content cache](https://github.com/abhibagul/openreco/blob/main/openreco/engine/cache.py): `openreco/engine/cache.py`
- [Run context](https://github.com/abhibagul/openreco/blob/main/openreco/engine/context.py): `openreco/engine/context.py`

### Reconstruction pipeline

- [Photo ingest](https://github.com/abhibagul/openreco/blob/main/openreco/stages/ingest.py): `openreco/stages/ingest.py`
- [SfM alignment](https://github.com/abhibagul/openreco/blob/main/openreco/stages/sfm.py): `openreco/stages/sfm.py`
- [Georeferencing](https://github.com/abhibagul/openreco/blob/main/openreco/stages/georef.py): `openreco/stages/georef.py`
- [Dense reconstruction](https://github.com/abhibagul/openreco/blob/main/openreco/stages/mvs.py): `openreco/stages/mvs.py`
- [Mesh and texture](https://github.com/abhibagul/openreco/tree/main/openreco/stages): `openreco/stages`

### Mapping products

- [DSM and DTM](https://github.com/abhibagul/openreco/tree/main/openreco/stages): `openreco/stages`
- [Contours and coverage](https://github.com/abhibagul/openreco/tree/main/openreco/stages): `openreco/stages`

### Outputs and analysis

- [Pipeline export](https://github.com/abhibagul/openreco/blob/main/openreco/stages/export.py): `openreco/stages/export.py`
- [Format exporters](https://github.com/abhibagul/openreco/blob/main/openreco/exporters.py): `openreco/exporters.py`
- [Raster I/O](https://github.com/abhibagul/openreco/blob/main/openreco/io/raster.py): `openreco/io/raster.py`
- [Point-cloud I/O](https://github.com/abhibagul/openreco/blob/main/openreco/io/pointcloud.py): `openreco/io/pointcloud.py`
- [Survey measurements](https://github.com/abhibagul/openreco/blob/main/openreco/measure.py): `openreco/measure.py`
- [Run report](https://github.com/abhibagul/openreco/blob/main/openreco/engine/report.py): `openreco/engine/report.py`
- [3D web viewer](https://github.com/abhibagul/openreco/tree/main/openreco/viewer): `openreco/viewer`

### Other components

- **Project user**

## Connections

- Project user → CLI: starts run
- Project user → Python API: scripts run (evidence: `openreco/api.py`)
- Project user → Local UI: operates project
- CLI → DAG runner: runs pipeline (evidence: `openreco/cli.py`)
- Python API → DAG runner: runs pipeline (evidence: `openreco/api.py`)
- Local UI → DAG runner: starts runs (evidence: `openreco/ui/server.py`)
- Local UI → Workflow mapping: configures stages (evidence: `openreco/ui/server.py`)
- Python API → Project manifest: loads project (evidence: `openreco/api.py`)
- DAG runner → Project manifest: reads stages (evidence: `openreco/engine/runner.py`)
- DAG runner → Stage runtime: dispatches stages (evidence: `openreco/engine/runner.py`)
- DAG runner → Content cache: checks and writes (evidence: `openreco/engine/runner.py`)
- DAG runner → Run context: provides context (evidence: `openreco/engine/runner.py`)
- Stage runtime → Run context: accepts context (evidence: `openreco/engine/stage.py`)
- Photo ingest → SfM alignment: supplies photos
- SfM alignment → Georeferencing: supplies model
- Georeferencing → Dense reconstruction: supplies georeference
- Dense reconstruction → Mesh and texture: supplies dense cloud (evidence: `openreco/stages/__init__.py`)
- Mesh and texture → DSM and DTM: supplies geometry
- DSM and DTM → Contours and coverage: generates map products
- Contours and coverage → Pipeline export: feeds export (evidence: `openreco/stages/__init__.py`)
- Pipeline export → Format exporters: converts products (evidence: `openreco/exporters.py`)
- Format exporters → Point-cloud I/O: writes clouds (evidence: `openreco/exporters.py`)
- Format exporters → Raster I/O: writes rasters (evidence: `openreco/exporters.py`)
- DSM and DTM → Raster I/O: writes GeoTIFF (evidence: `openreco/stages/coverage.py`)
- DSM and DTM → Survey measurements: supports analysis
- DAG runner → Run report: records run (evidence: `openreco/engine/runner.py`)
- Pipeline export → 3D web viewer: builds viewer output
