Giter Club home page Giter Club logo

vnlb's Introduction

Video Non-Local Bayes (VNLB)

A Python Implementation for Video Non-Local Bayesian Denoiser.

Install

The package is available through Python pip,

$ python -m pip install vnlb --user

Or the package can be downloaded through github,

$ git clone https://github.com/gauenk/vnlb/
$ cd vnlb
$ python -m pip install -r requirements.txt --user
$ python -m pip install -e ./lib --user

Usage

We expect the images to be shaped (nframes,channels,height,width) with pixel values in range [0,...,255.]. The color channels are ordered RGB. Common examples of noise levels are 10, 20 and 50. See scripts/example.py for more details.

import vnlb
import numpy as np

# -- get data --
clean = vnlb.testing.load_dataset("davis_64x64",vnlb=False)[0]['clean'].copy()[:3]              
# (nframes,channels,height,width)

# -- add noise --
std = 20.
noisy = np.random.normal(clean,scale=std)

# -- Video Non-Local Bayes --
deno,basic,dtime = vnlb.denoise(noisy,std)

# -- compute denoising quality --
deno_psnr = vnlb.utils.compute_psnrs(clean,deno)
basic_psnr = vnlb.utils.compute_psnrs(clean,basic)
print("Denoised PSNRs:")
print(deno_psnrs)
print("Basic PSNRs:")
print(basic_psnrs)
print("Execution Time (s): %2.2e" % dtime)

Comparing with C++ Code

The outputs from this VNLB code and the C++ Code are almost equal. The primary difference between to two method is the way in which we achieve parallelism. This difference impacts the final PSNR, especially on smaller images. More details are included in docs/COMPARE.md. Note too there is no optical flow computed within this method to account for large motion changes. This must be computed separately and passed to the function call.

Credits

This code provides is a Python+GPU implementation of the video denoising method (VNLB) described in:

P. Arias, J.-M. Morel. "Video denoising via empirical Bayesian estimation of space-time patches", Journal of Mathematical Imaging and Vision, 60(1), January 2018.

Additionally, the original C++ code is from Pablo Arias. For easier interfacing, a Swig-Python Wrapper of the original C++ Code is available here.

LICENSE

Licensed under the GNU Affero General Public License v3.0, see LICENSE.

vnlb's People

Contributors

gauenk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.