- Python 100%
| saved_models | ||
| .gitlab-ci.yml | ||
| denoise.py | ||
| high_iso_noise.JPG | ||
| prepare_data.py | ||
| README.md | ||
| requirements-ci.txt | ||
| requirements.txt | ||
| train.py | ||
Keras Denoiser
A simple Keras Denoiser, made of convolutionnal only models, so it's very fast, even on CPU (about 5 seconds for a high resolution image using a Ryzen 1700)
Also, it uses almost only backend agnostic functions, the sole exception being the DSSIM loss. A reimplementation of this loss in Keras is progress.
Usage
$ ./denoise.py -i INPUT_FILE --model MODEL.h5 [--output OUTPUT]
It'll then use MODEL.h5 to denoise file INPUT_FILE. By default, OUTPUT="denoised_$INPUT_FILE"
Train
$ ./train.py --noise {poisson,gaussian,salt,pepper,wavelet,luminance,inpainting,greyscale,highiso,slight_blur,simple_blur,gaussian_blur,none} [{poisson,gaussian,salt,pepper,wavelet,luminance,inpainting,greyscale,highiso,slight_blur,simple_blur,gaussian_blur,none} --name MODEL_NAME --dataset DATASET_DIRECTORY --val_data VALIDATION_DATASET_DIRECTORY --batch_size BATCH_SIZE --architecture (large5|large5bis|xlarge,etc. (see train.py for more details)) [--twopass (0|1)] --epochs 10000 --epochs_secondpass 5000
| Option | Default | Explanation |
|---|---|---|
--name |
keras_denoiser_model-TIMESTAMP |
The model filename |
--noise |
{poisson,gaussian} |
The noises used to real-time augment the images from the dataset. You can combine as many as you want. |
--architecture |
simple |
The architecture of the model (layers, activations, etc). There are plenty of them. For now, the best ones seems to be large5 and large5bis |
--twopass |
0 |
Wether to add several simple layers to the model after the end of the first training, then freeze the first part of the model, and train again, for additional filtering. When this option is used, the two models will be saved independently at the end of the training (with -twopass suffix for the second model). |
Prepare data
$ ./prepare_data.py --size SIZE --dir OUTPUT_DIR --func {crop,iso} INPUT_DIR
Use this function to preprocess images to be used for training. Basically, it crops images to SIZExSIZEx3 (converts RGBA and Greyscale image to RGB) by selecting only the center of the image, and outputs them in the specified directory. Some very heavy preprocessing can be done here as well, like adding real high ISO noise to the images (it took too long when it was in realtime). I do not use it a lot actually.