How bhar07gavi/cloud_removal works
The repository implements paired-image preprocessing, pix2pix GAN training and evaluation, experiment tracking, and a local Gradio inference demo for satellite cloud removal. The main workflow prepares RICE image pairs into patches and splits, trains a generator against a PatchGAN discriminator, evaluates saved weights, and serves cloud-removal predictions. README claims are supplemented with the sampled evaluation and tuning implementations; wiring not shown in excerpts is omitted.
Main entry points: train.py GAN training loop · eval.py Test-set evaluation · inference.py Inference pipeline · preprocess.py Patch preprocessing
Components 18
Data preparation
- Patch preprocessing
src/data/preprocess.py - Patches and splits
- Paired patch loader
src/data/dataset.py
GAN training
- GAN training loop
src/training/train.py - U-Net generator
src/models/generator.py - PatchGAN discriminator
src/models/discriminator.py - GAN and L1 losses
src/training/losses.py - Model checkpoints
Evaluation and tuning
- MLflow tracking
- Test-set evaluation
src/models/eval.py - Hyperparameter sweep
src/training/tune.py
Interactive serving
- Gradio interface
serving/demo_app.py - Inference pipeline
serving/inference.py
Other components
- Dataset operator
- RICE image pairs
- ML engineer
- DAGsHub MLflow
- Demo user
Connections 23
- Dataset operator → Patch preprocessing: starts preprocessing
- RICE image pairs → Patch preprocessing: reads pairs
- Patch preprocessing → Patches and splits: writes patches and splits
- Patches and splits → Paired patch loader: provides split files
- Paired patch loader → GAN training loop: provides paired batches
- ML engineer → GAN training loop: starts training
- GAN training loop → U-Net generator: updates generator
- GAN training loop → PatchGAN discriminator: updates discriminator
- GAN training loop → GAN and L1 losses: computes objectives
- GAN training loop → Model checkpoints: saves best weights
- GAN training loop → MLflow tracking: logs metrics and artifacts
- MLflow tracking → DAGsHub MLflow: records experiment
- Test-set evaluation → Paired patch loader: loads test patches
- Test-set evaluation → Model checkpoints: loads generator weights
- Test-set evaluation → U-Net generator: runs predictions
- Test-set evaluation → MLflow tracking: logs evaluation metrics
- Hyperparameter sweep → GAN training loop: runs trial training
- Hyperparameter sweep → MLflow tracking: logs sweep runs
- Demo user → Gradio interface: uploads image
- Gradio interface → Inference pipeline: requests prediction
- Inference pipeline → Model checkpoints: loads weights
- Inference pipeline → U-Net generator: generates reconstruction
- Inference pipeline → Gradio interface: returns image