OpenImageDenoise

Project link: GitHub - RenderKit/oidn: Intel® Open Image Denoise library

Motivation

OpenImageDenoise is a dependency of Blender, one that is especially useful on non-workstation machines, as it masks a lot of the raytracing noise that comes with doing fewer render passes, as a lower-powered device would do.

Example (before and after of the Blender scene “Spring”, using an intentionally low sample count of 10):

Status

Working, can be built yourself from scratch from source.

Compiling

To compile the current main branch, follow th einstructions below.

As the project uses submodules, clone the parent repo with --recurse-submodules, as follows:

git clone --recurse-submodules https://github.com/RenderKit/oidn cd oidn

You will also need the native ARM64 ISPC compiler: https://drive.google.com/file/d/1X_qIfjVFeSqXdQqHpDLGkpGwbB4kO-im/view?usp=sharing

And a copy of oneTBB (debug and release builds): https://drive.google.com/file/d/1ui4KbtzK4aCIMhVChb_iirCwnKhzP4RV/view?usp=sharing

Then execute the following (inside the oidn dir) from a native ARM64 vcvarsall:

mkdir build cd build cmake -G "Visual Studio 17 2022" .. -DTBB_ROOT=<tbb release or debug folder as appropriate> -DISPC_EXECUTABLE=<path to ispc executable>

You should then be able to build it via the newly generated VS solution, or via

cmake --build .

NOTE: It is not possible to switch easily between debug and release builds in VS - you have to delete the build folder and start over, as you need the corresponsing tbb install dir for the config.

Running

Compiling successfully will give you a number of binaries in the directory. A simple app that just applies denoising can be found under the name oidnDenoise.exe to run this, you need the following file

Full-res: https://drive.google.com/file/d/1lXaGymIcz1uB7mO7bwNp8-H8mMRsfQTu/view?usp=sharing

Note that this image is in little-endian “PFM” format, the only image viewer I have been able to find that opens it is the ImageMagick “IMDisplay” app. You will need to be able to open the files to compare the before and after.

Once you have your file, you can run the denoiser via the following command line:

And observe the result by opening bmwFiltered.pfm in ImageMagick.

Notes

No notes - this works OOB after an implementation by Intel themselves.

Further Reading

DNND 1: a Deep Neural Network Dive

https://maxliani.wordpress.com/2023/03/24/dnnd-2-tensors-and-convolution/

https://maxliani.wordpress.com/2023/04/07/dnnd-3-the-u-net-architecture/

These are a set of atricles that talk about how neural networks work, but interestingly the author uses OIDN as their basis, so lots of the diagrams and pseudocode are useful in understanding OIDN