- [ ] 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".
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
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
parser.add_argument('--input_dir',type=str,default='./PyTorchCheckpoint/',help='directory of saved checkpoints for denoising operation or retraining')
# #name for user #name for program #type #default values #explanation sentences
parser.add_argument('--input_dir',dest='input_dir',type=str,default='./PyTorchCheckpoint/',help='directory of saved checkpoints for denoising operation or retraining')
parser.add_argument('--train_dir',dest='train_dir',type=str,default='./Holography/DATABASE/',help='directory of training database')
parser.add_argument('--eval_dir',dest='eval_dir',type=str,default='./Holography/DATABASE/',help='directory of training database')
parser.add_argument('--test_dir',dest='test_dir',type=str,default='./Holography/DATAEVAL/DATAEVAL/',help='directory of testing database')
parser.add_argument('--save_test_dir',dest='save_test_dir',type=str,default='./TestImages/',help='directory where results of de-noising operation will be saved')
parser.add_argument('--train_patterns',dest='train_patterns',type=int,nargs='+',default=(1,2,3,4,5),help='patterns used for training')
parser.add_argument('--train_noises',dest='train_noises',type=str,default="0-1-1.5-2-2.5",help='noise levels used for training ')
parser.add_argument('--eval_patterns',dest='eval_patterns',type=int,nargs='+',default=(1,2,3,4,5),help='patterns used for eval')
parser.add_argument('--eval_noises',dest='eval_noises',type=str,default="0-1-1.5-2-2.5",help='noise levels used for eval ')
parser.add_argument('--test_patterns',dest='test_patterns',type=int,nargs='+',default=(1,2,3,4,5),help='patterns used for testing')
parser.add_argument('--test_noises',dest='test_noises',type=str,default="0-1-1.5-2-2.5",help='noise levels used for testing ')
parser.add_argument('--clean_train',dest='clean_train',type=str,default='data1/img_clean_train_1-2-3-4-5_0-1-1.5-2-2.5_two_50_50_384.npy',help='filepath of noise free file for training')
parser.add_argument('--noisy_train',dest='noisy_train',type=str,default='data1/img_noisy_train_1-2-3-4-5_0-1-1.5-2-2.5_two_50_50_384.npy',help='filepath of noisy file for training')
parser.add_argument('--clean_eval',dest='clean_eval',type=str,default='data1/img_clean_train_1-2-3_0-1-1.5two.npy',help='filepath of noise free file for eval')
parser.add_argument('--noisy_eval',dest='noisy_eval',type=str,default='data1/img_noisy_train_1-2-3_0-1-1.5two.npy',help='filepath of noisy file for eval')
parser.add_argument('--num_epochs',dest='num_epochs',type=int,default=200,help='number of epochs to train')
parser.add_argument('--D',dest='D',type=int,default=4,help='number of dilated convolutional layer (resBlock)')
parser.add_argument('--C',dest='C',type=int,default=64,help='kernel size of convolutional layer')
parser.add_argument('--plot',dest='plot',action='store_true',help='plot loss during training')
parser.add_argument('--lr',dest='lr',type=float,default=1e-3,help='learning rate for training')
parser.add_argument('--clean_train',type=str,default='data1/img_clean_train_1-2-3-4-5_0_two_50_50_9.npy',help='filepath of noise clean file for training')
parser.add_argument('--noisy_train',type=str,default='data1/img_noisy_train_1-2-3-4-5_0_two_50_50_9.npy',help='filepath of noisy file for training')
parser.add_argument('--train_image_size',dest='train_image_size',type=int,nargs='+',default=(50,50),help='size of train images')
parser.add_argument('--eval_image_size',dest='eval_image_size',type=int,nargs='+',default=(1024,1024),help='size of eval images')
parser.add_argument('--test_image_size',dest='test_image_size',type=int,nargs='+',default=(1024,1024),help='size of test images')
parser.add_argument('--image_mode',dest='image_mode',type=int,default=1,help='1 or 3 (black&white or RGB)')