Skip to content

irisdum/cGAN_sent2_sim

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
env
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

cGAN_sent2_sim

These software codes can be used for non-profit academic research only. They are distributed under the terms of the GNU general public license v3.

Code corresponding to I. Dumeur, Y. Chen, F. Sur, Z.-S. Zhou. Sentinel-2 RGB and NIR bands simulation after fire events using a multi-temporal conditional generative adversarial network. Research report HAL-03327421, 2021, https://hal.archives-ouvertes.fr/hal-03327421

Data used for this research are available in : https://drive.google.com/drive/folders/1PSob58o66WE5l-RDcImVcrc67C7HlDCR?usp=sharing

The environment :

Use the specific training conda environment : env/training_env.yaml :

conda env create -f env/training_env.yaml
conda activate training_env
python -m ipykernel install --user --name=training_env

Start a training

With Jupyter

Start jupyter notebook. If in a remote machine : add --ip=0.0.0.0 --no-browser

You can open the jupyter Notebook : notebooks/Trainings.ipynb

Modify the constant, defined at the beginning at the notebook and run the training.

As a batch job

The conditional GAN model used is defined in models/clean_gan.py In order to train a model two yaml should be modified, examples available in GAN_confs :

  • model.yaml
  • train.yaml Then run gan_train.sh path_to_model_yaml path_to_train_yaml

Supervise the training

Tensorboard : metric supervision

The training is also configured to be supervised using Tensorboard.

Open a new terminal window within training_env and run tensorboard.

Local command tensorboard --logdir <path>

If in remote machine : tensorboard --logdir <path> --host 0.0.0.0

Validation image visualization : notebook

Eventually you can also look at how the images look like during the training.

Open the notebook Figure_plot

Prediction

To run prediction of the model. You can run in python predict.py --model_path ${model_path} --tr_nber ${train_nber} --dataset ${dataset} --pref ${pref} --weights ${weight}

model_path : path where all the training directories of one model are contained tr_nber: number used to name the training directory dataset : path to the directory which contains the two subdirectories dataX and test pref : string used to name the directory where all the predicted tiles are saved weights: int, corresponds of the weights from the model and training number to use to run the prediction

You can also use the gan_predict.sh or look at the Makefile with make predict command.

Compute metrics

Open Notebooks Assessment_cGAN_CD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published