# c237814486/oa-stereo architecture

> Architecture diagram of the GitHub repository c237814486/oa-stereo, 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/c237814486/oa-stereo
- Repository: https://github.com/c237814486/oa-stereo

## Overview

OA-Stereo is a self-supervised underwater perception system that combines calibrated stereo-camera and forward-looking-sonar inputs to estimate dense depth. The main workflow loads paired optical/sonar data and calibration, predicts disparity with an iterative fusion network, and trains through stereo and sonar consistency losses; validation and visualization expose the results and robustness. The graph also preserves the documented SIGC capability. Some implementation details are unsampled, so those branches are represented at module level and only documented or indexed relationships are connected.

Main entry points: [`train.py`](https://github.com/c237814486/oa-stereo/blob/main/train.py) (Training loop), [`src/oa_stereo.py`](https://github.com/c237814486/oa-stereo/blob/main/src/oa_stereo.py) (OA-Stereo network), [`valid.py`](https://github.com/c237814486/oa-stereo/blob/main/valid.py) (Validation metrics), [`show.py`](https://github.com/c237814486/oa-stereo/blob/main/show.py) (Prediction visualization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Data and calibration"]
  node_dataset["Stereo-sonar datasets<br/>[datasets.py]"]
  node_augment["Data augmentation<br/>[datasets.py]"]
  node_config["Run configuration<br/>[options.py]"]
end

subgraph group_perception["Stereo perception"]
  node_model["OA-Stereo network<br/>[oa_stereo.py]"]
  node_features["Feature and sonar encoders<br/>[networks.py]"]
  node_refinement["Iterative disparity refinement<br/>[networks.py]"]
  node_blocks["Network building blocks<br/>[utils_net.py]"]
end

subgraph group_learning["Training and evaluation"]
  node_trainer["Training loop<br/>[train.py]"]
  node_validator["Validation metrics<br/>[valid.py]"]
  node_visualizer["Prediction visualization<br/>[show.py]"]
  node_loss["Self-supervised losses<br/>[loss.py]"]
end

subgraph group_geometry["Geometry and utilities"]
  node_geometry["Projection and sonar geometry<br/>[utils.py]"]
end

node_operator(("Researcher"))
node_data_source[("Underwater dataset")]
node_depth["Dense depth estimate"]

node_operator -->|"configures training"| node_trainer
node_operator -->|"runs validation"| node_validator
node_operator -->|"views predictions"| node_visualizer
node_data_source -->|"provides samples"| node_dataset
node_dataset -->|"applies augmentation"| node_augment
node_trainer -->|"reads options"| node_config
node_trainer -->|"loads training data"| node_dataset
node_trainer -->|"creates model"| node_visualizer
node_visualizer -->|"reads options"| node_config
node_visualizer -->|"constructs and runs"| node_model
node_trainer -->|"evaluates during training"| node_validator
node_trainer -->|"uses training loss"| node_loss
node_trainer -->|"runs stereo inference"| node_model
node_validator -->|"loads validation data"| node_dataset
node_validator -->|"predicts disparity"| node_model
node_model -->|"extracts features"| node_features
node_model -->|"updates disparity"| node_refinement
node_features -->|"uses layers"| node_blocks
node_features -->|"uses shared utilities"| node_geometry
node_model -->|"projects sonar information"| node_geometry
node_loss -->|"reconstructs and aligns"| node_geometry
node_model -->|"estimates dense depth"| node_depth

click node_dataset "https://github.com/c237814486/oa-stereo/blob/main/src/datasets.py"
click node_augment "https://github.com/c237814486/oa-stereo/blob/main/src/datasets.py"
click node_config "https://github.com/c237814486/oa-stereo/blob/main/options.py"
click node_trainer "https://github.com/c237814486/oa-stereo/blob/main/train.py"
click node_validator "https://github.com/c237814486/oa-stereo/blob/main/valid.py"
click node_visualizer "https://github.com/c237814486/oa-stereo/blob/main/show.py"
click node_loss "https://github.com/c237814486/oa-stereo/blob/main/src/loss.py"
click node_model "https://github.com/c237814486/oa-stereo/blob/main/src/oa_stereo.py"
click node_features "https://github.com/c237814486/oa-stereo/blob/main/src/networks.py"
click node_refinement "https://github.com/c237814486/oa-stereo/blob/main/src/networks.py"
click node_blocks "https://github.com/c237814486/oa-stereo/blob/main/src/utils_net.py"
click node_geometry "https://github.com/c237814486/oa-stereo/blob/main/src/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_dataset,node_augment,node_config toneBlue
class node_model,node_features,node_refinement,node_blocks,node_data_source toneAmber
class node_trainer,node_validator,node_visualizer,node_loss toneMint
class node_geometry toneRose
class node_operator,node_depth toneIndigo
```

## Components

### Data and calibration

- [Stereo-sonar datasets](https://github.com/c237814486/oa-stereo/blob/main/src/datasets.py): `src/datasets.py`
- [Data augmentation](https://github.com/c237814486/oa-stereo/blob/main/src/datasets.py): `src/datasets.py`
- [Run configuration](https://github.com/c237814486/oa-stereo/blob/main/options.py): `options.py`

### Stereo perception

- [OA-Stereo network](https://github.com/c237814486/oa-stereo/blob/main/src/oa_stereo.py): `src/oa_stereo.py`
- [Feature and sonar encoders](https://github.com/c237814486/oa-stereo/blob/main/src/networks.py): `src/networks.py`
- [Iterative disparity refinement](https://github.com/c237814486/oa-stereo/blob/main/src/networks.py): `src/networks.py`
- [Network building blocks](https://github.com/c237814486/oa-stereo/blob/main/src/utils_net.py): `src/utils_net.py`

### Training and evaluation

- [Training loop](https://github.com/c237814486/oa-stereo/blob/main/train.py): `train.py`
- [Validation metrics](https://github.com/c237814486/oa-stereo/blob/main/valid.py): `valid.py`
- [Prediction visualization](https://github.com/c237814486/oa-stereo/blob/main/show.py): `show.py`
- [Self-supervised losses](https://github.com/c237814486/oa-stereo/blob/main/src/loss.py): `src/loss.py`

### Geometry and utilities

- [Projection and sonar geometry](https://github.com/c237814486/oa-stereo/blob/main/src/utils.py): `src/utils.py`

### Other components

- **Researcher**
- **Underwater dataset**
- **Dense depth estimate**

## Connections

- Researcher → Training loop: configures training (evidence: `README.md`)
- Researcher → Validation metrics: runs validation (evidence: `README.md`)
- Researcher → Prediction visualization: views predictions (evidence: `README.md`)
- Underwater dataset → Stereo-sonar datasets: provides samples (evidence: `README.md`)
- Stereo-sonar datasets → Data augmentation: applies augmentation (evidence: `src/datasets.py`)
- Training loop → Run configuration: reads options (evidence: `train.py`)
- Training loop → Stereo-sonar datasets: loads training data (evidence: `train.py`)
- Training loop → Prediction visualization: creates model (evidence: `train.py`)
- Prediction visualization → Run configuration: reads options (evidence: `show.py`)
- Prediction visualization → OA-Stereo network: constructs and runs (evidence: `show.py`)
- Training loop → Validation metrics: evaluates during training (evidence: `train.py`)
- Training loop → Self-supervised losses: uses training loss (evidence: `train.py`)
- Training loop → OA-Stereo network: runs stereo inference (evidence: `train.py`)
- Validation metrics → Stereo-sonar datasets: loads validation data (evidence: `valid.py`)
- Validation metrics → OA-Stereo network: predicts disparity (evidence: `valid.py`)
- OA-Stereo network → Feature and sonar encoders: extracts features (evidence: `src/oa_stereo.py`)
- OA-Stereo network → Iterative disparity refinement: updates disparity (evidence: `src/oa_stereo.py`)
- Feature and sonar encoders → Network building blocks: uses layers (evidence: `src/networks.py`)
- Feature and sonar encoders → Projection and sonar geometry: uses shared utilities (evidence: `src/networks.py`)
- OA-Stereo network → Projection and sonar geometry: projects sonar information (evidence: `src/oa_stereo.py`)
- Self-supervised losses → Projection and sonar geometry: reconstructs and aligns (evidence: `src/loss.py`)
- OA-Stereo network → Dense depth estimate: estimates dense depth (evidence: `README.md`)
