# hemanthreddykunduru/change-detection-in-satellite-images architecture

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

- Interactive diagram: https://gitdiagram.com/hemanthreddykunduru/change-detection-in-satellite-images
- Repository: https://github.com/hemanthreddykunduru/change-detection-in-satellite-images

## Overview

This repository is a batch GeoTIFF object-detection pipeline. It reads images from `cropped`, runs sliced model inference, saves annotated images, and processes each detection into a crop and geographic coordinates before storing its metadata in PostgreSQL. The source shows `starter.py` orchestrating these stages and `detection.py` implementing detection and geospatial/image operations. No README is provided, so the graph reflects the sampled source and tree only.

Main entry points: [`starter.py`](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/starter.py) (Batch runner), [`detection.py`](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/detection.py) (Object detector), [`database.py`](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/database.py) (Detection table writer), [`cropped`](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/tree/master/cropped) (GeoTIFF inputs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Batch workflow"]
  node_runner["Batch runner<br/>[starter.py]"]
  node_inputs["GeoTIFF inputs"]
end

subgraph group_detection["Detection and geospatial processing"]
  node_detector["Object detector<br/>[detection.py]"]
  node_sahi["SAHI inference"]
  node_geo["Geo coordinate conversion<br/>[detection.py]"]
end

subgraph group_outputs["Artifacts and persistence"]
  node_visual["Annotated GeoTIFFs"]
  node_crops["Object crops"]
  node_db_writer["Detection table writer<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
end

node_operator(("Pipeline operator"))

node_operator -->|"starts batch"| node_runner
node_runner -->|"reads images"| node_inputs
node_runner -->|"requests predictions"| node_detector
node_detector -->|"runs sliced inference"| node_sahi
node_runner -->|"requests visualization"| node_detector
node_detector -->|"writes annotated images"| node_visual
node_runner -->|"requests crops"| node_detector
node_detector -->|"writes image crops"| node_crops
node_runner -->|"requests coordinate conversion"| node_detector
node_runner -->|"converts pixel bounds"| node_geo
node_runner -->|"creates tables and saves detections"| node_db_writer
node_db_writer -->|"writes records"| node_postgres

click node_runner "https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/starter.py"
click node_inputs "https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/tree/master/cropped"
click node_detector "https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/detection.py"
click node_geo "https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/detection.py"
click node_visual "https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/tree/master/detected"
click node_crops "https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/tree/master/objects"
click node_db_writer "https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/database.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_inputs toneBlue
class node_detector,node_sahi,node_geo toneAmber
class node_visual,node_crops,node_db_writer,node_postgres toneMint
class node_operator toneIndigo
```

## Components

### Batch workflow

- [Batch runner](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/starter.py): `starter.py`
- [GeoTIFF inputs](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/tree/master/cropped): `cropped`

### Detection and geospatial processing

- [Object detector](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/detection.py): `detection.py`
- **SAHI inference**
- [Geo coordinate conversion](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/detection.py): `detection.py`

### Artifacts and persistence

- [Annotated GeoTIFFs](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/tree/master/detected): `detected`
- [Object crops](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/tree/master/objects): `objects`
- [Detection table writer](https://github.com/hemanthreddykunduru/change-detection-in-satellite-images/blob/master/database.py): `database.py`
- **PostgreSQL**

### Other components

- **Pipeline operator**

## Connections

- Pipeline operator → Batch runner: starts batch
- Batch runner → GeoTIFF inputs: reads images
- Batch runner → Object detector: requests predictions
- Object detector → SAHI inference: runs sliced inference
- Batch runner → Object detector: requests visualization
- Object detector → Annotated GeoTIFFs: writes annotated images
- Batch runner → Object detector: requests crops
- Object detector → Object crops: writes image crops
- Batch runner → Object detector: requests coordinate conversion
- Batch runner → Geo coordinate conversion: converts pixel bounds
- Batch runner → Detection table writer: creates tables and saves detections
- Detection table writer → PostgreSQL: writes records
