# ayushgigras/crackvision-ai architecture

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

- Interactive diagram: https://gitdiagram.com/ayushgigras/crackvision-ai
- Repository: https://github.com/ayushgigras/crackvision-ai

## Overview

CrackGauge is a command-line computer-vision tool for turning concrete images into crack masks and width, length, and orientation measurements, optionally scaled to millimetres. The principal workflow begins at main.py, which orchestrates preprocessing, segmentation, measurement, and calibration. The README also describes PDF inspection reports, but no report module appears in the supplied tree or excerpts; that capability is shown as documented rather than verified implementation. Edges reflect the shown orchestration and documented calibration options; unsampled behavior is not inferred.

Main entry points: [`main.py`](https://github.com/ayushgigras/crackvision-ai/blob/main/main.py) (Pipeline runner), [`src/preprocessing.py`](https://github.com/ayushgigras/crackvision-ai/blob/main/src/preprocessing.py) (Image preprocessing), [`src/segmentation.py`](https://github.com/ayushgigras/crackvision-ai/blob/main/src/segmentation.py) (Crack segmentation), [`src/measurement.py`](https://github.com/ayushgigras/crackvision-ai/blob/main/src/measurement.py) (Width, length, orientation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Pipeline entry"]
  node_runner["Pipeline runner<br/>[main.py]"]
  node_report["PDF inspection report<br/>[main.py]"]
end

subgraph group_vision["Image analysis"]
  node_prep["Image preprocessing<br/>[preprocessing.py]"]
  node_segment["Crack segmentation<br/>[segmentation.py]"]
end

subgraph group_metrics["Crack metrics"]
  node_measure["Width, length, orientation<br/>[measurement.py]"]
end

subgraph group_scale["Physical calibration"]
  node_calibrate["Scale and ArUco calibration<br/>[calibration.py]"]
end

node_inspector(("Inspector"))

node_inspector -->|"selects image"| node_runner
node_runner -->|"runs preprocessing"| node_prep
node_runner -->|"runs segmentation"| node_segment
node_runner -->|"runs measurement"| node_measure
node_runner -->|"resolves scale"| node_calibrate
node_runner -.->|"generates report"| node_report

click node_runner "https://github.com/ayushgigras/crackvision-ai/blob/main/main.py"
click node_prep "https://github.com/ayushgigras/crackvision-ai/blob/main/src/preprocessing.py"
click node_segment "https://github.com/ayushgigras/crackvision-ai/blob/main/src/segmentation.py"
click node_measure "https://github.com/ayushgigras/crackvision-ai/blob/main/src/measurement.py"
click node_calibrate "https://github.com/ayushgigras/crackvision-ai/blob/main/src/calibration.py"
click node_report "https://github.com/ayushgigras/crackvision-ai/blob/main/main.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_runner,node_report toneBlue
class node_prep,node_segment toneAmber
class node_measure toneMint
class node_calibrate toneRose
class node_inspector toneIndigo
```

## Components

### Pipeline entry

- [Pipeline runner](https://github.com/ayushgigras/crackvision-ai/blob/main/main.py): `main.py`
- [PDF inspection report](https://github.com/ayushgigras/crackvision-ai/blob/main/main.py): `main.py`

### Image analysis

- [Image preprocessing](https://github.com/ayushgigras/crackvision-ai/blob/main/src/preprocessing.py): `src/preprocessing.py`
- [Crack segmentation](https://github.com/ayushgigras/crackvision-ai/blob/main/src/segmentation.py): `src/segmentation.py`

### Crack metrics

- [Width, length, orientation](https://github.com/ayushgigras/crackvision-ai/blob/main/src/measurement.py): `src/measurement.py`

### Physical calibration

- [Scale and ArUco calibration](https://github.com/ayushgigras/crackvision-ai/blob/main/src/calibration.py): `src/calibration.py`

### Other components

- **Inspector**

## Connections

- Inspector → Pipeline runner: selects image (evidence: `README.md`)
- Pipeline runner → Image preprocessing: runs preprocessing (evidence: `main.py`)
- Pipeline runner → Crack segmentation: runs segmentation (evidence: `main.py`)
- Pipeline runner → Width, length, orientation: runs measurement (evidence: `main.py`)
- Pipeline runner → Scale and ArUco calibration: resolves scale (evidence: `main.py`)
- Pipeline runner → PDF inspection report: generates report (evidence: `README.md`)
