A Python implementation of the Video Non-Local Bayes Denoising Method
Project description
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.
Credits
This code provides is a Python+GPU implementation of the video denoising method (VNLB) described in:
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
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file vnlb-0.1.0.tar.gz
.
File metadata
- Download URL: vnlb-0.1.0.tar.gz
- Upload date:
- Size: 48.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/30.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.48.2 importlib-metadata/4.8.2 keyring/23.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d8235ee3b4c42adb5225436513e5814509e4c680d5f124bc45efaee50dc1774 |
|
MD5 | 1584c6018763c001ab32d2e48e2da8f7 |
|
BLAKE2b-256 | 3e9f99f524d6aba7763aac25d2313790eadcbb448d5810087293bf6e076fdcc8 |
File details
Details for the file vnlb-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: vnlb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 58.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/30.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.48.2 importlib-metadata/4.8.2 keyring/23.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3c1631b590d9f0bc655bdf3a3f009f307dfa8a5a15e219a8ba01e199d2f7dfd |
|
MD5 | 7aedc46006d9809b3a599f7e045e8d1d |
|
BLAKE2b-256 | 3973ef845ef557141deccbd415fef0200e5fd2413442aaa273bf98e7c355b395 |