GithubHelp home page GithubHelp logo

vidit631 / vnlnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from axeldavy/vnlnet

0.0 0.0 0.0 236.44 MB

VNLnet is a Video denoising CNN with Non-locality information

License: GNU General Public License v3.0

Python 71.38% C 20.96% Cython 7.66%

vnlnet's Introduction

vnlnet

VNLnet is a Video denoising CNN with Non-locality information

More details in our paper: Non-Local Video Denoising by CNN

https://arxiv.org/abs/1811.12758

If you use any part of our code for another project, please cite our paper.

The code to reproduce the training database is available here: https://github.com/cmla/f16-video-set

The code to reproduce our davis test-dev test set is available here: https://github.com/cmla/downscaled-davis-dataset

The data of the second testing set should be available soon.

Similarly, if you use any part of these codes for another project, please cite our paper.

**** Requirements ****

pyTorch >= 0.4.0 numpy imageio tifffile pyopencl

OpenCL >= 1.2 CUDA (for training)

You can install the python requirements with: pip install -r requirements.txt --user

**** General Info ****

The patch search is implemented in OpenCL. To run the code, a valid OpenCL driver is required. A CPU OpenCL driver can be used for testing, even though the code was tuned for GPUs. For example, on Ubuntu and NVidia GPU, you must install nvidia-opencl-dev.

If using CUDA, please notice that CUDA_VISIBLE_DEVICES also affects the visible OpenCL devices.

**** Training Info ****

Assuming the training and validation data are in directories train/ and val/, the training command is: python3 train.py --epochs 20 --milestone 12 17 --sigma 20 --oracle_mode 0 --past_frames 7 --future_frames 7 --search_window_width 41 --nn_patch_width 41 --pass_nn_value --save_dir vnlnet_gray_20 --train_dir train/ --val_dir val/

The parameters are described in train.py. More particularly, oracle_mode describes whether to use the noise free image for the patch search (but not for the pixel data). This enables to evaluate the performance gap compared to if a perfect patch matching was available.

You might want to previously set PYOPENCL_CTX (for example export PYOPENCL_CTX=0) to define the OpenCL device to use for the patch search code.

Pretrained models:

This repository contains several pretrained models. For example, vnlnet_gray_20 corresponds to vnlnet trained on gray images for noise 20. The same naming pattern is used for the other files.

**** Testing Info ****

The video sequence to denoise must be extracted in a directory. Assuming the video to denoise is alone in the directory inputs/, you can denoise the sequence with:

python3 test.py directory --net vnlnet_gray_20.pth --input inputs/ --output outputs/

Assuming vnlnet_gray_20 corresponds to best network for your estimated noise.

For benchmarking purposes, a noise-free sequence can be given with the parameter --add-noise to add a noise of standard deviation corresponding to what the network was trained for. If passing sequences with already generated synthetic noise for comparison with another method, it is more accurate to pass tiff files encoding floating point data.

If only the result on one image matters, the argument --only_frame can be used to specify the only frame to denoise.

If testing on a system without CUDA, --cpu can be used to run the network on cpu. It still requires a working OpenCL driver (which can be CPU or GPU, but we recommand a powerful GPU).

Assuming the video is not alone in the directory inputs (and is named with the pattern video_001.png, ... video_300.png), or only a subset of frames need to be denoised (for example from 100 to 199), this command line can be used:

python3 test.py pattern --net vnlnet_gray_20.pth --input_pattern inputs/video_%03d.png --output outputs/video_%03d.png --first 100 --last 199

**** Scoring Info ****

To compute the PSNR or the SSIM on some video sequence, we included several scripts.

psnr.py computes the psnr for a video sequence ssim.py computes the ssim score for a video sequence

vnlnet's People

Contributors

axeldavy avatar vidit631 avatar nikunj018 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.