# anandraj239/solar-farms-segmentation-liss-iv architecture

> Architecture diagram of the GitHub repository anandraj239/solar-farms-segmentation-liss-iv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anandraj239/solar-farms-segmentation-liss-iv
- Repository: https://github.com/anandraj239/solar-farms-segmentation-liss-iv

## Overview

This repository is a remote-sensing research pipeline for training and running three solar-farm segmentation approaches on Resourcesat LISS-IV imagery: Attention U-Net, SegFormer, and DINOv2. The user-facing workflow is to train a model from image/mask datasets, then run scene inference to create raster predictions and cleaned geospatial polygon outputs. Training and inference scripts are separate per model. README documents dataset annotation, comparative evaluation, and visualization in QGIS; those capabilities are represented where the tree supports them. Source excerpts show inference internals but not a direct training-to-inference invocation, so that handoff is left unasserted.

Main entry points: [`Models/pytorch_infernce/infe_pyt.py`](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_infernce/infe_pyt.py) (U-Net scene inference), [`Models/Segformer_inference/inference_segformer.py`](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer_inference/inference_segformer.py) (SegFormer scene inference), [`Models/DINOv2_Inference/DINOv2_inference.py`](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2_Inference/DINOv2_inference.py) (DINOv2 scene inference), [`Models/pytorch_gpu/pytorch_gpu.py`](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_gpu/pytorch_gpu.py) (Attention U-Net training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model Training"]
  node_unet_train["Attention U-Net training<br/>[pytorch_gpu.py]"]
  node_seg_train["SegFormer training<br/>[segformer_model.py]"]
  node_dino_train["DINOv2 training<br/>[dino.py]"]
  node_unet_model["Attention U-Net<br/>[pytorch_gpu.py]"]
  node_seg_model["SegFormer model<br/>[segformer_model.py]"]
  node_dino_model["DINOv2 model<br/>[dino.py]"]
  node_model_artifacts["Model settings &amp; thresholds"]
  node_unet_artifacts["U-Net normalization data"]
end

subgraph group_inference["Scene Inference"]
  node_unet_infer["U-Net scene inference<br/>[infe_pyt.py]"]
  node_seg_infer["SegFormer scene inference"]
  node_dino_infer["DINOv2 scene inference"]
  node_seg_tiles["Tiled raster processing"]
  node_dino_tiles["Tiled raster processing"]
  node_unet_tiles["Tiled raster processing<br/>[infe_pyt.py]"]
end

subgraph group_outputs["Geospatial Outputs"]
  node_raster_outputs["Prediction rasters"]
  node_vector_outputs["Solar boundary shapefiles"]
end

subgraph group_evaluation["Evaluation &amp; Review"]
  node_visual_review["QGIS visual review"]
  node_metrics["Benchmark metrics<br/>[README.md]"]
end

node_analyst(("Remote-sensing analyst"))
node_imagery["LISS-IV imagery"]
node_labels["Solar masks"]
node_external_backbone["Hugging Face model weights"]

node_analyst -->|"trains with"| node_unet_train
node_analyst -->|"trains with"| node_seg_train
node_analyst -->|"trains with"| node_dino_train
node_imagery -->|"provides tiles"| node_unet_train
node_labels -->|"provides masks"| node_unet_train
node_imagery -->|"provides tiles"| node_seg_train
node_labels -->|"provides masks"| node_seg_train
node_imagery -->|"provides tiles"| node_dino_train
node_labels -->|"provides masks"| node_dino_train
node_unet_train -->|"optimizes"| node_unet_model
node_seg_train -->|"optimizes"| node_seg_model
node_dino_train -->|"optimizes"| node_dino_model
node_seg_train -->|"writes settings"| node_model_artifacts
node_dino_train -->|"writes settings"| node_model_artifacts
node_unet_train -->|"saves normalization"| node_unet_artifacts
node_analyst -->|"runs on scene"| node_unet_infer
node_analyst -->|"runs on scene"| node_seg_infer
node_analyst -->|"runs on scene"| node_dino_infer
node_imagery -->|"supplies scene"| node_unet_infer
node_imagery -->|"supplies scene"| node_seg_infer
node_imagery -->|"supplies scene"| node_dino_infer
node_unet_infer -->|"constructs tiles"| node_unet_tiles
node_seg_infer -->|"constructs tiles"| node_seg_tiles
node_dino_infer -->|"constructs tiles"| node_dino_tiles
node_external_backbone -.->|"initializes encoder"| node_seg_model
node_external_backbone -->|"initializes encoder"| node_dino_model
node_unet_infer -->|"writes predictions"| node_raster_outputs
node_seg_infer -->|"writes predictions"| node_raster_outputs
node_dino_infer -->|"writes predictions"| node_raster_outputs
node_unet_infer -->|"exports polygons"| node_vector_outputs
node_seg_infer -->|"exports polygons"| node_vector_outputs
node_dino_infer -->|"exports polygons"| node_vector_outputs
node_vector_outputs -->|"reviewed in"| node_visual_review
node_analyst -->|"compares models"| node_metrics

click node_unet_train "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_gpu/pytorch_gpu.py"
click node_seg_train "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer/segformer_model.py"
click node_dino_train "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2/dino.py"
click node_unet_model "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_gpu/pytorch_gpu.py"
click node_seg_model "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer/segformer_model.py"
click node_dino_model "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2/dino.py"
click node_unet_infer "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_infernce/infe_pyt.py"
click node_seg_infer "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer_inference/inference_segformer.py"
click node_dino_infer "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2_Inference/DINOv2_inference.py"
click node_seg_tiles "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer_inference/inference_segformer.py"
click node_dino_tiles "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2_Inference/DINOv2_inference.py"
click node_unet_tiles "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_infernce/infe_pyt.py"
click node_model_artifacts "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer/segformer_config.json"
click node_unet_artifacts "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/U-Net_pytorch_gpu/normalization_values.txt"
click node_raster_outputs "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/tree/main/Models/Segformer_inference"
click node_vector_outputs "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/tree/main/Models/Segformer_inference"
click node_visual_review "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/tree/main/assets/QGIS_Screenshot%20_230726"
click node_metrics "https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/README.md"

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_unet_train,node_seg_train,node_dino_train,node_unet_model,node_seg_model,node_dino_model,node_model_artifacts,node_unet_artifacts toneBlue
class node_unet_infer,node_seg_infer,node_dino_infer,node_seg_tiles,node_dino_tiles,node_unet_tiles toneAmber
class node_raster_outputs,node_vector_outputs toneMint
class node_visual_review,node_metrics toneRose
class node_analyst,node_imagery,node_labels,node_external_backbone toneIndigo
```

## Components

### Model Training

- [Attention U-Net training](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_gpu/pytorch_gpu.py): `Models/pytorch_gpu/pytorch_gpu.py`
- [SegFormer training](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer/segformer_model.py): `Models/Segformer/segformer_model.py`
- [DINOv2 training](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2/dino.py): `Models/DINOv2/dino.py`
- [Attention U-Net](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_gpu/pytorch_gpu.py): `Models/pytorch_gpu/pytorch_gpu.py`
- [SegFormer model](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer/segformer_model.py): `Models/Segformer/segformer_model.py`
- [DINOv2 model](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2/dino.py): `Models/DINOv2/dino.py`
- [Model settings & thresholds](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer/segformer_config.json): `Models/Segformer/segformer_config.json`
- [U-Net normalization data](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/U-Net_pytorch_gpu/normalization_values.txt): `Models/U-Net_pytorch_gpu/normalization_values.txt`

### Scene Inference

- [U-Net scene inference](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_infernce/infe_pyt.py): `Models/pytorch_infernce/infe_pyt.py`
- [SegFormer scene inference](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer_inference/inference_segformer.py): `Models/Segformer_inference/inference_segformer.py`
- [DINOv2 scene inference](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2_Inference/DINOv2_inference.py): `Models/DINOv2_Inference/DINOv2_inference.py`
- [Tiled raster processing](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/Segformer_inference/inference_segformer.py): `Models/Segformer_inference/inference_segformer.py`
- [Tiled raster processing](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/DINOv2_Inference/DINOv2_inference.py): `Models/DINOv2_Inference/DINOv2_inference.py`
- [Tiled raster processing](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/Models/pytorch_infernce/infe_pyt.py): `Models/pytorch_infernce/infe_pyt.py`

### Geospatial Outputs

- [Prediction rasters](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/tree/main/Models/Segformer_inference): `Models/Segformer_inference`
- [Solar boundary shapefiles](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/tree/main/Models/Segformer_inference): `Models/Segformer_inference`

### Evaluation & Review

- [QGIS visual review](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/tree/main/assets/QGIS_Screenshot%20_230726): `assets/QGIS_Screenshot _230726`
- [Benchmark metrics](https://github.com/anandraj239/solar-farms-segmentation-liss-iv/blob/main/README.md): `README.md`

### Other components

- **Remote-sensing analyst**
- **LISS-IV imagery**
- **Solar masks**
- **Hugging Face model weights**

## Connections

- Remote-sensing analyst → Attention U-Net training: trains with (evidence: `README.md`)
- Remote-sensing analyst → SegFormer training: trains with (evidence: `README.md`)
- Remote-sensing analyst → DINOv2 training: trains with (evidence: `README.md`)
- LISS-IV imagery → Attention U-Net training: provides tiles (evidence: `Models/pytorch_gpu/pytorch_gpu.py`)
- Solar masks → Attention U-Net training: provides masks (evidence: `Models/pytorch_gpu/pytorch_gpu.py`)
- LISS-IV imagery → SegFormer training: provides tiles (evidence: `Models/Segformer/segformer_model.py`)
- Solar masks → SegFormer training: provides masks (evidence: `Models/Segformer/segformer_model.py`)
- LISS-IV imagery → DINOv2 training: provides tiles (evidence: `Models/DINOv2/dino.py`)
- Solar masks → DINOv2 training: provides masks (evidence: `Models/DINOv2/dino.py`)
- Attention U-Net training → Attention U-Net: optimizes (evidence: `Models/pytorch_gpu/pytorch_gpu.py`)
- SegFormer training → SegFormer model: optimizes (evidence: `Models/Segformer/segformer_model.py`)
- DINOv2 training → DINOv2 model: optimizes (evidence: `Models/DINOv2/dino.py`)
- SegFormer training → Model settings & thresholds: writes settings (evidence: `Models/Segformer/segformer_model.py`)
- DINOv2 training → Model settings & thresholds: writes settings (evidence: `Models/DINOv2/dino.py`)
- Attention U-Net training → U-Net normalization data: saves normalization (evidence: `Models/pytorch_gpu/pytorch_gpu.py`)
- Remote-sensing analyst → U-Net scene inference: runs on scene (evidence: `README.md`)
- Remote-sensing analyst → SegFormer scene inference: runs on scene (evidence: `README.md`)
- Remote-sensing analyst → DINOv2 scene inference: runs on scene (evidence: `README.md`)
- LISS-IV imagery → U-Net scene inference: supplies scene (evidence: `Models/pytorch_infernce/infe_pyt.py`)
- LISS-IV imagery → SegFormer scene inference: supplies scene (evidence: `Models/Segformer_inference/inference_segformer.py`)
- LISS-IV imagery → DINOv2 scene inference: supplies scene (evidence: `Models/DINOv2_Inference/DINOv2_inference.py`)
- U-Net scene inference → Tiled raster processing: constructs tiles (evidence: `Models/pytorch_infernce/infe_pyt.py`)
- SegFormer scene inference → Tiled raster processing: constructs tiles (evidence: `Models/Segformer_inference/inference_segformer.py`)
- DINOv2 scene inference → Tiled raster processing: constructs tiles (evidence: `Models/DINOv2_Inference/DINOv2_inference.py`)
- Hugging Face model weights → SegFormer model: initializes encoder (evidence: `Models/Segformer/segformer_model.py`)
- Hugging Face model weights → DINOv2 model: initializes encoder
- U-Net scene inference → Prediction rasters: writes predictions (evidence: `Models/pytorch_infernce/infe_pyt.py`)
- SegFormer scene inference → Prediction rasters: writes predictions (evidence: `Models/Segformer_inference/inference_segformer.py`)
- DINOv2 scene inference → Prediction rasters: writes predictions (evidence: `Models/DINOv2_Inference/DINOv2_inference.py`)
- U-Net scene inference → Solar boundary shapefiles: exports polygons (evidence: `Models/pytorch_infernce/infe_pyt.py`)
- SegFormer scene inference → Solar boundary shapefiles: exports polygons (evidence: `Models/Segformer_inference/inference_segformer.py`)
- DINOv2 scene inference → Solar boundary shapefiles: exports polygons (evidence: `Models/DINOv2_Inference/DINOv2_inference.py`)
- Solar boundary shapefiles → QGIS visual review: reviewed in (evidence: `README.md`)
- Remote-sensing analyst → Benchmark metrics: compares models (evidence: `README.md`)
