Commit 96d1f8f8 authored by Mano Brabant's avatar Mano Brabant
Browse files

Update README.md

parent 1a40f74b
......@@ -115,3 +115,61 @@ Epochs | lr | train noise | nb batches | layers | duration | 0 | 1 |
- [x] check final evaluation phase
- [ ] check loading checkpoint (but not latest) from a previous model
- [ ] move to PyTorch
##Manual
You have to manualy download the holography database and put it in the directory.
The database can be found on skinner /info/etu/m1/s171085/Projets/Portage-Keras-PyTorch/Portage-reseau-de-neurones-de-Keras-vers-PyTorch/dncnn-tensorflow-holography-master/Holography (a new link will be available later)
The application can be used with the main_holo.py script with different arguments from the argument.py script
To start a training with default param you can use the command
```
#launch a training
python3 main_holo.py
```
You can precise the training and eval data with the arguments noisy_train, clean_train, noisy_eval and clean_eval
The usable data are generated with the generate_patches_holo.py and generate_patches_holo_fromMAT.py scripts and saved in a directory named "data1".
```
#launch a training with the following data
python3 main_holo.py --noisy_train data1/img_noisy_train_1-2-3-4-5_0-1-1.5-2-2.5_two_50_50_384.npy --clean_train data1/img_clean_train_1-2-3-4-5_0-1-1.5-2-2.5_two_50_50_384.npy --noisy_eval data1/img_noisy_train_1-2-3-4-5_0-1-1.5-2-2.5_two_50_50_384.npy --clean_eval data1/img_clean_train_1-2-3-4-5_0-1-1.5-2-2.5_two_50_50_384.npy
```
You can also precise the different hyperparameter for the training
num_epoch is the number of epoch the model will train
D is the number of res block
C is the kernel size for convolutional layer (not tested)
```
#launch a training with the following params
python3 main_holo.py --num_epoch 500 --D 16 --C 32
```
For data adapation you have to give the size and the number of channel of the image you will be using in the argument image_size and image_mode (for training or testing).
```
#launch a training in which the image will be 50 by 50 in black and white
python3 main_holo.py --image_size 50 50 --image_mode 1
```
The arguments input_dir and epoch are used for re-training and de-noising operation.
In input_dir give the path to the model you want to use, and in epoch give the number from which you want to re-train or do a de-noising operation.
The model are saved in a directory named "PyTorchExperiments"
```
#re launch a training strating from the model experiment_xxx at the epoch 130
python3 main_holo.py --input_dir PyTorchExperiments/experiment_xxx --epoch 130
```
To do a de-noising operation you can use the test_mode argument.
You can use the argument test_noisy_img, test_noisy_key, test_clean_img and test_clean_key to precise which image you want to de-noise
```
#launch a denoising operation on the image DATA_1_Phase_Type1_2_0.25_1.5_4_50.mat with the model experiment_xxx at the epoch 130
python3 main_holo.py --test_mode --test_noisy_img Holography/DATAEVAL/DATAEVAL/DATA_1_Phase_Type1_2_0.25_1.5_4_50.mat --test_noisy_key 'Phaseb' --test_clean_img Holography/DATAEVAL/DATAEVAL/DATA_1_Phase_Type1_2_0.25_1.5_4_50.mat --test_clean_key 'Phase' --input_dir PyTorchExperiments/experiment_xxx --epoch 130
```
If you do not give an image to de-noise an evaluation of the entire training and testing database you start.
```
#launch a denoising operation on the 25 images of Holography/DATABASE and Holography/DATAEVAL/DATAEVAL database with the model experiment_xxx at the epoch 130
python3 main_holo.py --test_mode --input_dir PyTorchExperiments/experiment_xxx --epoch 130
```
The results of those de-noising operation can be found in a TestImages directory
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment