ViDeNN: Deep Blind Video Denoising
This repository contains my master thesis project called ViDeNN - Deep Blind Video Denoising.
Paper
http://openaccess.thecvf.com/content_CVPRW_2019/papers/NTIRE/Claus_ViDeNN_Deep_Blind_Video_Denoising_CVPRW_2019_paper.pdf
Introduction
With this pretrained tensorflow model you will be able to denoise videos affected by different types of degradation, such as Additive White Gaussian Noise and videos in Low-Light conditions. The latter has been tested only on one particular camera raw data, so it might not work on different sources. ViDeNN works in blind conditions, it does not require any information over the content of the input noisy video.
IMPORTANT! If you want to denoise data affected by Gaussian noise (AWGN), it has to be clipped between 0 and 255 before denoising it, otherwise you will get strange artifacts in your denoised output.
Final Result
|
(noise=15) PSNR |
Performance(s / epoch) |
Competition baseline(Powered by GPU) |
33.66 |
432 |
Ours result(Powered by Ascend 910A) |
33.69 |
170 |
Structure Directory
|-- img ----For README.md
|-- Spatial-CNN ----Code path
|--ckpt ----Automatically generated model storage path
|--logs ----Automatically generated log storage path
|--add_noise_spatialCNN.py ----Dataset preprocessing file
|--dataset_preparation.sh ----Dataset preparation and processing scripts, only run for the first time
|--generate_patches_spatialCNN.py ----Dataset preprocessing file
|--main_spatialCNN.py ----main train code
|--model_spatialCNN.py ----model code
|--train_spatial_cnn.sh ----NPU training startup script
|--utilis.py ----NPU training startup script
|-- LICENSE ----Other file
|-- README.md ----Read me
Quickstart
Installation
- TensorFlow 1.15.0
- Python 3.7.5
Note that this code runs based on Huawei Cloud ModelArts and uses Ascend 910A.
Train the model
- Prepare dataset
$ cd Spatial-CNN
$ bash dataset_preparation.sh
- The dataset preparation script downloads the image dataset and prepare the correct folder structure, running it once is enough.
- Note that let's introduce the usage and meaning of some files in the above script:
(1) python add_noise_spatialCNN.py can creates clean-noisy samples adding noise. Currently AWGN noise is implemented. (There is also realistic_noise function if you want to play with it).
(2) python generate_patches_spatialCNN.py can generates the 50x50 clean-noisy patches which will be used for training. They will be stored in two big binary files, which will be loaded in your ram during training.
- Start train
$ bash train_spatial_cnn.sh
- Note that let's introduce the usage and meaning of some files in the above script:
(1) python main_spatialCNN.py, this starts training, storing a checkpoint every epoch. Check the available arguments with python main_spatialCNN.py -h
if you want to set the number of epochs, learning rate, batch size etc.
(2) If you want to fine tune the pre-trained AWGN model use: python main_spatialCNN.py --checkpoint_dir=ckpt_awgn --epoch=500
- View results
After the program runs, you can get the following two files:
train_spatialCNN.log
test_spatialCNN.log
Here, we can see the final performance and accuracy indicators.
The final test results can be obtained by executing the following commands at the terminal:
$ cat test_spatialCNN.log | grep 'Average PSNR' -B 1
Issues?
Feel free to open an issue if you have any problem, I will do my best to help you.
My E-mail: tjulitianyi@163.com