How anandraj239/srm-sentinel2-superresolution works
This repository presents a Sentinel-2 super-resolution and land-cover mapping workflow: prepare synthetic low-/high-resolution patch pairs, train or run 4× SwinIR enhancement, classify the enhanced image with SegFormer, and evaluate or visualize outputs. The clearest executable end-to-end path is in scripts/full_inference.py; dataset preparation, segmentation, metrics, and comparison tools are separate scripts. Training and the broader download-to-classify capability are documented, but no downloader or training implementation is present in the supplied tree, so those links rely on README evidence.
Main entry points: full_inference.py Enhanced image · prepare_dataset.py Training pairs · train_swinir_satellite.yml SwinIR training setup · calculate_metrics.py Image metrics
Components 15
Satellite Data Preparation
- Sentinel-2 imagery
- Patch cropping
scripts/crop_patch.py - Training pairs
scripts/prepare_dataset.py
Enhancement and Classification
- SwinIR training setup
scripts/train_swinir_satellite.yml - SwinIR super-resolution
scripts/full_inference.py - SegFormer classification
scripts/full_inference.py - Segmentation runner
scripts/segformer_inference.py - Enhanced image
scripts/full_inference.py - Class map and overlay
scripts/full_inference.py
Evaluation and Results
- Image metrics
scripts/calculate_metrics.py - Metrics report
results/metrics_report.txt - Result comparisons
scripts/compare_results.py - Pipeline comparison
scripts/final_comparison.py
Presentation
- Interactive demo
demo.py
Other components
- Analyst
Connections 14
- Sentinel-2 imagery → Patch cropping: reads bands
scripts/crop_patch.py - Sentinel-2 imagery → Training pairs: extracts patches
scripts/prepare_dataset.py - Training pairs → SwinIR training setup: supplies pairs
README.md - SwinIR training setup → SwinIR super-resolution: configures training
README.md - Analyst → SwinIR super-resolution: requests inference
README.md - SwinIR super-resolution → Enhanced image: writes enhancement
scripts/full_inference.py - Enhanced image → SegFormer classification: classifies image
scripts/full_inference.py - SegFormer classification → Class map and overlay: writes map and overlay
scripts/full_inference.py - Enhanced image → Segmentation runner: loads SR image
scripts/segformer_inference.py - Analyst → Image metrics: requests evaluation
README.md - Image metrics → Metrics report: writes metrics
scripts/calculate_metrics.py - Analyst → Result comparisons: requests comparison
scripts/compare_results.py - Analyst → Pipeline comparison: requests panel
scripts/final_comparison.py - Analyst → Interactive demo: starts demo
demo.py