# khushi-070906/v2t-graph architecture

> Architecture diagram of the GitHub repository khushi-070906/v2t-graph, 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/khushi-070906/v2t-graph
- Repository: https://github.com/khushi-070906/v2t-graph

## Overview

V-to-T Graph turns RGB frames into a navigation-aware semantic graph, ranks objects by affordance, distance, and heading, then produces spatial cues and spoken instructions for blind or low-vision users. The principal workflow is coordinated by `pipeline.py`; the live-camera variants repeat it continuously, with the tracked variant adding temporal confirmation and approach estimates. Depth calibration and evaluation are supporting product capabilities. The excerpts and README establish the main stages; some live-loop and evaluation internals are unsampled, so their uncertain connections are omitted.

Main entry points: [`pipeline.py`](https://github.com/khushi-070906/v2t-graph/blob/main/pipeline.py) (Single-frame pipeline), [`live_camera_loop_tracked.py`](https://github.com/khushi-070906/v2t-graph/blob/main/live_camera_loop_tracked.py) (Tracked camera loop), [`detect_depth.py`](https://github.com/khushi-070906/v2t-graph/blob/main/detect_depth.py) (Detection and depth), [`graph_builder.py`](https://github.com/khushi-070906/v2t-graph/blob/main/graph_builder.py) (Spatial graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Vision and geometry"]
  node_detector["Detection and depth<br/>[detect_depth.py]"]
  node_graph["Spatial graph<br/>[graph_builder.py]"]
end

subgraph group_attention["Attention selection"]
  node_pruner["Affordance pruning<br/>[pruning.py]"]
end

subgraph group_guidance["Guidance outputs"]
  node_encoder["Haptic and audio encoding<br/>[encoders.py]"]
  node_planner["Instruction planner"]
  node_speech["Offline speech<br/>[speech_output.py]"]
end

subgraph group_runtime["Runtime entry points"]
  node_pipeline["Single-frame pipeline<br/>[pipeline.py]"]
  node_live["Stateless camera loop"]
  node_tracked_live["Tracked camera loop"]
  node_tracker["Object tracking<br/>[tracker.py]"]
end

subgraph group_evaluation["Calibration and evaluation"]
  node_calibrate["Camera calibration<br/>[calibrate_depth.py]"]
  node_image_calibrate["Image calibration"]
  node_batch["Batch evaluation<br/>[batch_eval.py]"]
  node_walk["Simulated walk evaluation<br/>[simulate_walk.py]"]
  node_compression["Compression metrics"]
  node_visualize["Pruning visualization"]
  node_calibration_data["Calibration parameters<br/>[calibration.json]"]
end

node_user(("Low-vision user"))
node_frame["RGB frame"]

node_frame -->|"provides frame"| node_pipeline
node_pipeline -->|"runs detection"| node_detector
node_detector -->|"returns detections"| node_graph
node_pipeline -->|"builds graph"| node_graph
node_pipeline -->|"prunes graph"| node_pruner
node_pipeline -->|"encodes graph"| node_encoder
node_pipeline -->|"plans instructions"| node_planner
node_pipeline -->|"computes metrics"| node_compression
node_pipeline -.->|"speaks optionally"| node_speech
node_frame -->|"camera feed"| node_live
node_live -->|"runs detection"| node_detector
node_live -->|"speaks instructions"| node_speech
node_frame -->|"camera feed"| node_tracked_live
node_tracked_live -->|"runs detection"| node_detector
node_tracked_live -->|"updates tracks"| node_tracker
node_tracked_live -.->|"builds graph"| node_graph
node_tracked_live -.->|"prunes graph"| node_pruner
node_tracked_live -.->|"encodes graph"| node_encoder
node_tracked_live -.->|"plans instructions"| node_planner
node_tracked_live -.->|"speaks instructions"| node_speech
node_calibrate -->|"writes fit"| node_calibration_data
node_image_calibrate -.->|"writes fit"| node_calibration_data
node_calibration_data -->|"corrects depth"| node_detector
node_batch -->|"runs per frame"| node_pipeline
node_batch -->|"aggregates metrics"| node_compression
node_walk -->|"builds test graph"| node_graph
node_walk -->|"compares pruning"| node_pruner
node_visualize -.->|"loads detections"| node_detector
node_visualize -.->|"visualizes graph"| node_graph
node_visualize -.->|"visualizes pruning"| node_pruner
node_user -.->|"receives cues"| node_speech

click node_detector "https://github.com/khushi-070906/v2t-graph/blob/main/detect_depth.py"
click node_graph "https://github.com/khushi-070906/v2t-graph/blob/main/graph_builder.py"
click node_pruner "https://github.com/khushi-070906/v2t-graph/blob/main/pruning.py"
click node_encoder "https://github.com/khushi-070906/v2t-graph/blob/main/encoders.py"
click node_planner "https://github.com/khushi-070906/v2t-graph/blob/main/navigation_planner.py"
click node_speech "https://github.com/khushi-070906/v2t-graph/blob/main/speech_output.py"
click node_pipeline "https://github.com/khushi-070906/v2t-graph/blob/main/pipeline.py"
click node_live "https://github.com/khushi-070906/v2t-graph/blob/main/live_camera_loop.py"
click node_tracked_live "https://github.com/khushi-070906/v2t-graph/blob/main/live_camera_loop_tracked.py"
click node_tracker "https://github.com/khushi-070906/v2t-graph/blob/main/tracker.py"
click node_calibrate "https://github.com/khushi-070906/v2t-graph/blob/main/calibrate_depth.py"
click node_image_calibrate "https://github.com/khushi-070906/v2t-graph/blob/main/calibrate_depth_from_images.py"
click node_batch "https://github.com/khushi-070906/v2t-graph/blob/main/eval/batch_eval.py"
click node_walk "https://github.com/khushi-070906/v2t-graph/blob/main/eval/simulate_walk.py"
click node_compression "https://github.com/khushi-070906/v2t-graph/blob/main/compression_ratio.py"
click node_visualize "https://github.com/khushi-070906/v2t-graph/blob/main/visualize_pruning.py"
click node_calibration_data "https://github.com/khushi-070906/v2t-graph/blob/main/calibration.json"

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_detector,node_graph,node_user toneBlue
class node_pruner toneAmber
class node_encoder,node_planner,node_speech toneMint
class node_pipeline,node_live,node_tracked_live,node_tracker toneRose
class node_calibrate,node_image_calibrate,node_batch,node_walk,node_compression,node_visualize,node_calibration_data,node_frame toneIndigo
```

## Components

### Vision and geometry

- [Detection and depth](https://github.com/khushi-070906/v2t-graph/blob/main/detect_depth.py): `detect_depth.py`
- [Spatial graph](https://github.com/khushi-070906/v2t-graph/blob/main/graph_builder.py): `graph_builder.py`

### Attention selection

- [Affordance pruning](https://github.com/khushi-070906/v2t-graph/blob/main/pruning.py): `pruning.py`

### Guidance outputs

- [Haptic and audio encoding](https://github.com/khushi-070906/v2t-graph/blob/main/encoders.py): `encoders.py`
- [Instruction planner](https://github.com/khushi-070906/v2t-graph/blob/main/navigation_planner.py): `navigation_planner.py`
- [Offline speech](https://github.com/khushi-070906/v2t-graph/blob/main/speech_output.py): `speech_output.py`

### Runtime entry points

- [Single-frame pipeline](https://github.com/khushi-070906/v2t-graph/blob/main/pipeline.py): `pipeline.py`
- [Stateless camera loop](https://github.com/khushi-070906/v2t-graph/blob/main/live_camera_loop.py): `live_camera_loop.py`
- [Tracked camera loop](https://github.com/khushi-070906/v2t-graph/blob/main/live_camera_loop_tracked.py): `live_camera_loop_tracked.py`
- [Object tracking](https://github.com/khushi-070906/v2t-graph/blob/main/tracker.py): `tracker.py`

### Calibration and evaluation

- [Camera calibration](https://github.com/khushi-070906/v2t-graph/blob/main/calibrate_depth.py): `calibrate_depth.py`
- [Image calibration](https://github.com/khushi-070906/v2t-graph/blob/main/calibrate_depth_from_images.py): `calibrate_depth_from_images.py`
- [Batch evaluation](https://github.com/khushi-070906/v2t-graph/blob/main/eval/batch_eval.py): `eval/batch_eval.py`
- [Simulated walk evaluation](https://github.com/khushi-070906/v2t-graph/blob/main/eval/simulate_walk.py): `eval/simulate_walk.py`
- [Compression metrics](https://github.com/khushi-070906/v2t-graph/blob/main/compression_ratio.py): `compression_ratio.py`
- [Pruning visualization](https://github.com/khushi-070906/v2t-graph/blob/main/visualize_pruning.py): `visualize_pruning.py`
- [Calibration parameters](https://github.com/khushi-070906/v2t-graph/blob/main/calibration.json): `calibration.json`

### Other components

- **Low-vision user**
- **RGB frame**

## Connections

- RGB frame → Single-frame pipeline: provides frame (evidence: `README.md`)
- Single-frame pipeline → Detection and depth: runs detection (evidence: `pipeline.py`)
- Detection and depth → Spatial graph: returns detections (evidence: `graph_builder.py`)
- Single-frame pipeline → Spatial graph: builds graph (evidence: `pipeline.py`)
- Single-frame pipeline → Affordance pruning: prunes graph (evidence: `README.md`)
- Single-frame pipeline → Haptic and audio encoding: encodes graph (evidence: `pipeline.py`)
- Single-frame pipeline → Instruction planner: plans instructions (evidence: `pipeline.py`)
- Single-frame pipeline → Compression metrics: computes metrics (evidence: `pipeline.py`)
- Single-frame pipeline → Offline speech: speaks optionally (evidence: `README.md`)
- RGB frame → Stateless camera loop: camera feed (evidence: `live_camera_loop.py`)
- Stateless camera loop → Detection and depth: runs detection (evidence: `live_camera_loop.py`)
- Stateless camera loop → Offline speech: speaks instructions (evidence: `live_camera_loop.py`)
- RGB frame → Tracked camera loop: camera feed (evidence: `live_camera_loop_tracked.py`)
- Tracked camera loop → Detection and depth: runs detection (evidence: `live_camera_loop_tracked.py`)
- Tracked camera loop → Object tracking: updates tracks (evidence: `live_camera_loop_tracked.py`)
- Tracked camera loop → Spatial graph: builds graph (evidence: `live_camera_loop_tracked.py`)
- Tracked camera loop → Affordance pruning: prunes graph (evidence: `live_camera_loop_tracked.py`)
- Tracked camera loop → Haptic and audio encoding: encodes graph (evidence: `live_camera_loop_tracked.py`)
- Tracked camera loop → Instruction planner: plans instructions (evidence: `live_camera_loop_tracked.py`)
- Tracked camera loop → Offline speech: speaks instructions (evidence: `live_camera_loop_tracked.py`)
- Camera calibration → Calibration parameters: writes fit (evidence: `calibrate_depth.py`)
- Image calibration → Calibration parameters: writes fit
- Calibration parameters → Detection and depth: corrects depth (evidence: `README.md`)
- Batch evaluation → Single-frame pipeline: runs per frame (evidence: `eval/batch_eval.py`)
- Batch evaluation → Compression metrics: aggregates metrics (evidence: `eval/batch_eval.py`)
- Simulated walk evaluation → Spatial graph: builds test graph (evidence: `eval/simulate_walk.py`)
- Simulated walk evaluation → Affordance pruning: compares pruning (evidence: `eval/simulate_walk.py`)
- Pruning visualization → Detection and depth: loads detections (evidence: `visualize_pruning.py`)
- Pruning visualization → Spatial graph: visualizes graph (evidence: `visualize_pruning.py`)
- Pruning visualization → Affordance pruning: visualizes pruning (evidence: `visualize_pruning.py`)
- Low-vision user → Offline speech: receives cues
