How kevinsilvares/sentinel2-road-detection works
This repository builds a Sentinel-2 road and firebreak detection system: imagery can be acquired and prepared for super-resolution training, then super-resolved and segmented into a visual result. The graph preserves the documented ingestion, raster preparation, model-training, segmentation, and demo capabilities. Some training and mask-adaptation relationships are documented or named in the source index but their implementation excerpts were not sampled; those links cite the README or are omitted where ownership is unclear.
Main entry points: adapt_rasters_orchestator.py Raster adaptation · app.py Demo interface · train.py Segmentation training · dataset.py Segmentation dataset
Components 21
Imagery acquisition
- AOI grid
sen2sr_pipeline/raster_ingest/aoi_generator.py - Sentinel-2 downloader
sen2sr_pipeline/raster_ingest/raster_ingestion_orchestator.py - Copernicus client
sen2sr_pipeline/raster_ingest/copernicus_client.py
Raster preparation
- Raster adaptation
sen2sr_pipeline/raster_adaptation/adapt_rasters_orchestator.py - RGB-NIR joiner
sen2sr_pipeline/raster_adaptation/rgbn_joiner.py - Raster resampler
sen2sr_pipeline/raster_adaptation/raster_resampler.py - Paired raster tiler
sen2sr_pipeline/raster_adaptation/tiler.py
Super-resolution
- SR training dataset
sen2sr_pipeline/training_model/sr_dataset.py - SR model training
sen2sr_pipeline/training_model/train.py - SR inference
sen2sr_pipeline/resolver/resolver.py - SR paths config
sen2sr_pipeline/resolver/resolver_config.py
Road segmentation
- SegFormer model
segformer/model.py - Segmentation dataset
segformer/dataset.py - Image transforms
segformer/transformations.py - Segmentation training
segformer/train.py - Segmentation metrics
segformer/loss.py - Mask adaptation
segformer/raster_adaptation
Interactive demo
- Demo interface
app.py - Overlay result
app.py
Other components
- User
- Copernicus API
Connections 18
- User → Demo interface: submits raster
app.py - Demo interface → SR inference: runs inference
app.py - Demo interface → SegFormer model: runs segmentation
app.py - Demo interface → Overlay result: renders overlay
app.py - Sentinel-2 downloader → AOI grid: generates grid
sen2sr_pipeline/raster_ingest/raster_ingestion_orchestator.py - Sentinel-2 downloader → Copernicus client: requests imagery
sen2sr_pipeline/raster_ingest/raster_ingestion_orchestator.py - Copernicus client → Copernicus API: downloads imagery
sen2sr_pipeline/raster_ingest/copernicus_client.py - Raster adaptation → RGB-NIR joiner: joins bands
sen2sr_pipeline/raster_adaptation/adapt_rasters_orchestator.py - Raster adaptation → Raster resampler: resamples raster
sen2sr_pipeline/raster_adaptation/adapt_rasters_orchestator.py - Raster adaptation → Paired raster tiler: tiles pairs
sen2sr_pipeline/raster_adaptation/adapt_rasters_orchestator.py - SR model training → SR training dataset: loads samples
sen2sr_pipeline/training_model/train.py - SR inference → SR paths config: reads paths
sen2sr_pipeline/resolver/resolver.py - Segmentation training → Segmentation dataset: loads samples
segformer/train.py - Segmentation training → SegFormer model: trains model
segformer/train.py - Segmentation training → Segmentation metrics: evaluates predictions
segformer/train.py - Segmentation dataset → Image transforms: applies transforms
segformer/dataset.py - Mask adaptation → Segmentation dataset: prepares masks
README.md - Raster adaptation → SR model training: prepares training rasters
README.md