Inpainting
In construction: some parts of the README and the deposit are not up to date.
Prerequisites
Python modules to be installed. Advice : use conda env
conda create -n nn python=3.5
source activate nn
pip install netCDF4 h5py numpy scipy matplotlib xarray tensorflow keras scikit-learn scikit-gstat
Regarding tensorflow, you can have a more specific installation looking at the website: https://www.tensorflow.org/install/
You have to set keras config file (generally at ~/.keras/keras.json
)
{
"image_data_format": "channels_last",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "tensorflow"
}
Download data
- download data in
./data
folder
- for the complete set of data: link to base-chl.tgz
- for a small set (for quick testing): link to base-chl-small.tgz
- Uncompress the data with
tar -xvzf base-chl.tgz
ortar -xvzf base-chl-small.tgz
Create training set
- In file
make-trainset.py
:
- set the
basename
tomedchl.nc
ormedchl-small.nc
- set the
trainingname
denoted[TNAME]
- check the options (e.g. king of masking)
- run the file in a terminal:
./make-trainset.py
- Check some randomly picked images in
./figures/examples/[TNAME]
Note : you can always have a look at all the.nc
files using the softwarencview
Train a first network
Network based on paper: Pathak, D., Krähenbühl, P., Donahue, J., Darrell, T., & Efros, A. A. (n.d.). Context Encoders: Feature Learning by Inpainting. Retrieved from http://people.eecs.berkeley.edu/~pathak/papers/cvpr16.pdf
- In file
Inpainting.py
:
- set the
trainingname
to[TNAME]
- set the
name
to the name the neural network has to be saved (denoted[NETNAME]
)
- run the file in a terminal:
./Inpainting.py
Test the model
- In file
test_model.py
:
- set the
name
to[NETNAME]
- run the file in a terminal :
./test_model.py
- Check some randomly picked images in
./figures/exemples/[NETNAME]