# wzzheng/dvgt architecture

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

- Interactive diagram: https://gitdiagram.com/wzzheng/dvgt
- Repository: https://github.com/wzzheng/dvgt

## Overview

DVGT is an autonomous-driving vision and geometry framework: users provide multi-view driving images, and DVGT-1 predicts metric-scale dense point maps while DVGT-2 adds online reconstruction and trajectory planning. The repository also supports dataset preparation, model training, metric-based evaluation, and visualization. Edges reflect README statements or shown source/index references; some training and dataset wiring is configurable or unsampled, so those links are omitted rather than inferred.

Main entry points: [`dvgt/models/architectures/dvgt1.py`](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/architectures/dvgt1.py) (DVGT-1), [`dvgt/models/architectures/dvgt2.py`](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/architectures/dvgt2.py) (DVGT-2), [`dvgt/datasets/scene_dataset.py`](https://github.com/wzzheng/dvgt/blob/main/dvgt/datasets/scene_dataset.py) (Scene dataset), [`dvgt/evaluation/utils/metric_utils.py`](https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/utils/metric_utils.py) (Metric dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_prep["Annotation generation<br/>[main.py]"]
  node_loaders["Dataset loaders"]
  node_align["Depth alignment<br/>[alignment.py]"]
  node_scene["Scene dataset<br/>[scene_dataset.py]"]
  node_transforms["Sequence transforms"]
end

subgraph group_models["Geometry models"]
  node_dvgt1["DVGT-1<br/>[dvgt1.py]"]
  node_dvgt2["DVGT-2<br/>[dvgt2.py]"]
  node_agg1["DVGT-1 aggregator"]
  node_agg2["DVGT-2 aggregator"]
  node_pointhead["Dense point head<br/>[dpt_head.py]"]
  node_posehead["Pose heads"]
  node_trajectory["Trajectory decoder"]
  node_layers["Attention blocks<br/>[block.py]"]
end

subgraph group_learning["Training and evaluation"]
  node_trainer["Training engine<br/>[trainer.py]"]
  node_evaluator["Evaluation engine<br/>[evaluator.py]"]
end

subgraph group_analysis["Metrics and geometry"]
  node_metrics["Metric dispatch<br/>[metric_utils.py]"]
  node_depthmetrics["Depth metrics<br/>[depth_metrics.py]"]
  node_pointmetrics["Point cloud metrics"]
  node_evalgeom["Evaluation geometry<br/>[geometry.py]"]
  node_geom["Pose geometry<br/>[geometry.py]"]
end

subgraph group_viz["Visualization"]
  node_visual["Point cloud viewer<br/>[visual.py]"]
  node_visutils["Visualization utilities<br/>[utils.py]"]
end

node_driver(("Driving data user"))
node_images["Multi-view images"]
node_result["Reconstruction and plans"]

node_driver -->|"provides"| node_images
node_images -->|"infer from"| node_dvgt1
node_images -->|"infer from"| node_dvgt2
node_dvgt1 -->|"predicts points"| node_result
node_dvgt2 -->|"reconstructs and plans"| node_result
node_prep -->|"gets dataset"| node_loaders
node_prep -->|"references"| node_align
node_scene -->|"uses"| node_transforms
node_scene -->|"uses"| node_geom
node_scene -->|"reads"| node_images
node_dvgt1 -->|"calls"| node_agg1
node_dvgt1 -->|"calls"| node_pointhead
node_dvgt1 -->|"calls"| node_posehead
node_dvgt2 -->|"calls"| node_agg2
node_dvgt2 -->|"calls"| node_pointhead
node_agg2 -->|"uses blocks"| node_layers
node_layers -.->|"supports"| node_dvgt2
node_trainer -->|"imports"| node_geom
node_evaluator -->|"uses"| node_metrics
node_metrics -->|"dispatches"| node_depthmetrics
node_metrics -->|"dispatches"| node_pointmetrics
node_evalgeom -->|"uses"| node_geom
node_visual -->|"uses"| node_visutils
node_visual -->|"displays"| node_result

click node_prep "https://github.com/wzzheng/dvgt/blob/main/tools/data_process/main.py"
click node_loaders "https://github.com/wzzheng/dvgt/tree/main/tools/data_process/dataloaders"
click node_align "https://github.com/wzzheng/dvgt/blob/main/tools/data_process/utils/alignment.py"
click node_scene "https://github.com/wzzheng/dvgt/blob/main/dvgt/datasets/scene_dataset.py"
click node_transforms "https://github.com/wzzheng/dvgt/tree/main/dvgt/datasets/transforms"
click node_dvgt1 "https://github.com/wzzheng/dvgt/blob/main/dvgt/models/architectures/dvgt1.py"
click node_dvgt2 "https://github.com/wzzheng/dvgt/blob/main/dvgt/models/architectures/dvgt2.py"
click node_agg1 "https://github.com/wzzheng/dvgt/blob/main/dvgt/models/backbones/dvgt1_aggregator.py"
click node_agg2 "https://github.com/wzzheng/dvgt/blob/main/dvgt/models/backbones/dvgt2_aggregator.py"
click node_pointhead "https://github.com/wzzheng/dvgt/blob/main/dvgt/models/heads/dpt_head.py"
click node_posehead "https://github.com/wzzheng/dvgt/blob/main/dvgt/models/heads/dvgt1_ego_pose_head.py"
click node_trajectory "https://github.com/wzzheng/dvgt/blob/main/dvgt/models/heads/trajectory_pose_decoder.py"
click node_layers "https://github.com/wzzheng/dvgt/blob/main/dvgt/models/layers/block.py"
click node_trainer "https://github.com/wzzheng/dvgt/blob/main/dvgt/engine/trainer.py"
click node_evaluator "https://github.com/wzzheng/dvgt/blob/main/dvgt/engine/evaluator.py"
click node_metrics "https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/utils/metric_utils.py"
click node_depthmetrics "https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/metrics/depth_metrics.py"
click node_pointmetrics "https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/metrics/point_cloud_metrics.py"
click node_evalgeom "https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/utils/geometry.py"
click node_geom "https://github.com/wzzheng/dvgt/blob/main/dvgt/utils/geometry.py"
click node_visual "https://github.com/wzzheng/dvgt/blob/main/dvgt/visualization/visual.py"
click node_visutils "https://github.com/wzzheng/dvgt/blob/main/dvgt/visualization/utils.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_prep,node_loaders,node_align,node_scene,node_transforms,node_driver,node_images toneBlue
class node_dvgt1,node_dvgt2,node_agg1,node_agg2,node_pointhead,node_posehead,node_trajectory,node_layers toneAmber
class node_trainer,node_evaluator toneMint
class node_metrics,node_depthmetrics,node_pointmetrics,node_evalgeom,node_geom toneRose
class node_visual,node_visutils,node_result toneIndigo
```

## Components

### Data preparation

- [Annotation generation](https://github.com/wzzheng/dvgt/blob/main/tools/data_process/main.py): `tools/data_process/main.py`
- [Dataset loaders](https://github.com/wzzheng/dvgt/tree/main/tools/data_process/dataloaders): `tools/data_process/dataloaders`
- [Depth alignment](https://github.com/wzzheng/dvgt/blob/main/tools/data_process/utils/alignment.py): `tools/data_process/utils/alignment.py`
- [Scene dataset](https://github.com/wzzheng/dvgt/blob/main/dvgt/datasets/scene_dataset.py): `dvgt/datasets/scene_dataset.py`
- [Sequence transforms](https://github.com/wzzheng/dvgt/tree/main/dvgt/datasets/transforms): `dvgt/datasets/transforms`

### Geometry models

- [DVGT-1](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/architectures/dvgt1.py): `dvgt/models/architectures/dvgt1.py`
- [DVGT-2](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/architectures/dvgt2.py): `dvgt/models/architectures/dvgt2.py`
- [DVGT-1 aggregator](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/backbones/dvgt1_aggregator.py): `dvgt/models/backbones/dvgt1_aggregator.py`
- [DVGT-2 aggregator](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/backbones/dvgt2_aggregator.py): `dvgt/models/backbones/dvgt2_aggregator.py`
- [Dense point head](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/heads/dpt_head.py): `dvgt/models/heads/dpt_head.py`
- [Pose heads](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/heads/dvgt1_ego_pose_head.py): `dvgt/models/heads/dvgt1_ego_pose_head.py`
- [Trajectory decoder](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/heads/trajectory_pose_decoder.py): `dvgt/models/heads/trajectory_pose_decoder.py`
- [Attention blocks](https://github.com/wzzheng/dvgt/blob/main/dvgt/models/layers/block.py): `dvgt/models/layers/block.py`

### Training and evaluation

- [Training engine](https://github.com/wzzheng/dvgt/blob/main/dvgt/engine/trainer.py): `dvgt/engine/trainer.py`
- [Evaluation engine](https://github.com/wzzheng/dvgt/blob/main/dvgt/engine/evaluator.py): `dvgt/engine/evaluator.py`

### Metrics and geometry

- [Metric dispatch](https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/utils/metric_utils.py): `dvgt/evaluation/utils/metric_utils.py`
- [Depth metrics](https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/metrics/depth_metrics.py): `dvgt/evaluation/metrics/depth_metrics.py`
- [Point cloud metrics](https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/metrics/point_cloud_metrics.py): `dvgt/evaluation/metrics/point_cloud_metrics.py`
- [Evaluation geometry](https://github.com/wzzheng/dvgt/blob/main/dvgt/evaluation/utils/geometry.py): `dvgt/evaluation/utils/geometry.py`
- [Pose geometry](https://github.com/wzzheng/dvgt/blob/main/dvgt/utils/geometry.py): `dvgt/utils/geometry.py`

### Visualization

- [Point cloud viewer](https://github.com/wzzheng/dvgt/blob/main/dvgt/visualization/visual.py): `dvgt/visualization/visual.py`
- [Visualization utilities](https://github.com/wzzheng/dvgt/blob/main/dvgt/visualization/utils.py): `dvgt/visualization/utils.py`

### Other components

- **Driving data user**
- **Multi-view images**
- **Reconstruction and plans**

## Connections

- Driving data user → Multi-view images: provides (evidence: `README.md`)
- Multi-view images → DVGT-1: infer from (evidence: `README.md`)
- Multi-view images → DVGT-2: infer from (evidence: `README.md`)
- DVGT-1 → Reconstruction and plans: predicts points (evidence: `README.md`)
- DVGT-2 → Reconstruction and plans: reconstructs and plans (evidence: `README.md`)
- Annotation generation → Dataset loaders: gets dataset (evidence: `tools/data_process/main.py`)
- Annotation generation → Depth alignment: references (evidence: `tools/data_process/main.py`)
- Scene dataset → Sequence transforms: uses (evidence: `dvgt/datasets/scene_dataset.py`)
- Scene dataset → Pose geometry: uses (evidence: `dvgt/datasets/scene_dataset.py`)
- Scene dataset → Multi-view images: reads (evidence: `dvgt/datasets/scene_dataset.py`)
- DVGT-1 → DVGT-1 aggregator: calls (evidence: `dvgt/models/architectures/dvgt1.py`)
- DVGT-1 → Dense point head: calls (evidence: `dvgt/models/architectures/dvgt1.py`)
- DVGT-1 → Pose heads: calls (evidence: `dvgt/models/architectures/dvgt1.py`)
- DVGT-2 → DVGT-2 aggregator: calls (evidence: `dvgt/models/architectures/dvgt2.py`)
- DVGT-2 → Dense point head: calls (evidence: `dvgt/models/architectures/dvgt2.py`)
- DVGT-2 aggregator → Attention blocks: uses blocks (evidence: `dvgt/models/backbones/dvgt2_aggregator.py`)
- Attention blocks → DVGT-2: supports
- Training engine → Pose geometry: imports (evidence: `dvgt/engine/trainer.py`)
- Evaluation engine → Metric dispatch: uses (evidence: `dvgt/engine/evaluator.py`)
- Metric dispatch → Depth metrics: dispatches (evidence: `dvgt/evaluation/utils/metric_utils.py`)
- Metric dispatch → Point cloud metrics: dispatches (evidence: `dvgt/evaluation/utils/metric_utils.py`)
- Evaluation geometry → Pose geometry: uses (evidence: `dvgt/evaluation/utils/geometry.py`)
- Point cloud viewer → Visualization utilities: uses (evidence: `dvgt/visualization/visual.py`)
- Point cloud viewer → Reconstruction and plans: displays (evidence: `dvgt/visualization/visual.py`)
