This repository contains scripts for super-resolution of Sentinel-2 imagery using high-resolution NAIP (National Agriculture Imagery Program) aerial imagery. The pipeline leverages NAIP's sub-meter resolution to enhance Sentinel-2 data, with cloud masking, patch generation, and data augmentation for deep learning. Tested on Ubuntu with dependencies like geotile
and GDAL
.
-
Data Preprocessing: Intersect Sentinel-2 and NAIP imagery in Google Earth Engine (GEE) with a 1-day temporal delta. Apply Sentinel-2 cloud masks to NAIP and export to a Google Cloud Storage bucket.
-
Patch Generation: Create image patches using the
geotile
package. -
Data Augmentation: Augment patches for deep learning using
PIL
. -
Deep Learning: Train a super-resolution model (requires significant GPU resources).
- Operating System: Ubuntu (tested on 20.04)
- Hardware: GPU with substantial VRAM (e.g., NVIDIA GPUs with CUDA support)
- Storage: Sufficient space for NAIP and Sentinel-2 imagery (several GBs)
- Google Cloud: Access to a Google Cloud Storage bucket
- Google Earth Engine: Account and authentication for GEE
- Python: 3.8 or higher
- GDAL: Required for
geotile
- Python Packages:
geotile
: For patch generationPIL
(Pillow): For image augmentation- Others (e.g.,
numpy
,tensorflow
/pytorch
for deep learning)
GDAL is required for geotile
. Install on Ubuntu:
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt update
sudo apt install gdal-bin
Verify:
gdalinfo --version
More info: https://launchpad.net/~ubuntugis/+archive/ubuntu/ppa
pip install geotile
More info: https://geotile.readthedocs.io/en/latest/pages/install.html
pip install Pillow numpy
For deep learning:
pip install tensorflow
# OR
pip install torch torchvision
Authenticate GEE:
earthengine authenticate
Ensure access to a Google Cloud Storage bucket.
Intersects Sentinel-2 and NAIP imagery in GEE, applies cloud mask, and exports to bucket.
- Configure GEE credentials and bucket details.
- Run:
python preprocess.py
Input:
- NAIP imagery collection in GEE
- Sentinel-2 imagery collection in GEE
- Temporal delta: 1 day
Output:
- Cloud-masked NAIP imagery in bucket
Generates patches using geotile
.
- Ensure GDAL and
geotile
are installed. - Specify input imagery and output directory.
- Run:
python generate_patches.py
Input:
- Preprocessed NAIP and Sentinel-2 imagery
Output:
- Patches in specified directory
Augments patches using PIL
.
- Install
Pillow
. - Specify input patch directory and output directory.
- Run:
python augment.py
Input:
- Patches from previous step
Output:
- Augmented patches in specified directory
Configure model architecture and parameters in training script. Example:
see notebook
Ensure GPU drivers and CUDA are configured.
- NAIP Resolution: Sub-meter (<1m) resolution ideal for super-resolution.
- Cloud Masking: Sentinel-2 cloud mask ensures clean NAIP imagery.
- GPU Requirements: Training requires significant GPU power.