DeclanRussell / IntelOIDenoiser

A simple implementation of Intels Open Image denoiser -> https://github.com/OpenImageDenoise/oidn
MIT License
103 stars 19 forks source link

macOS and Linux support? #2

Open MCotocel opened 3 years ago

MCotocel commented 3 years ago

Is support for macOS and Linux planned?

DeclanRussell commented 3 years ago

I would love to do it but unfortunately I don't have a Linux environment or a Mac to be able to make the builds. If you have such an environment available, and are feeling tech savvy, you could of course try compiling the app yourself as there isn't anything platform dependent about the code. The hardest part will probably be compiling OIIO but you may be able to get that from a package manager. Perhaps this thread about compiling the Nvidia version of the denoiser on Linux could be useful as the build code is similar.

FlorentMasson commented 3 years ago

We made it work but it was rather uneasy.

It needed a few fixes in the code and updating SConstruct. The changes are in my fork

Here is basically the process we established:

brew install scons cmake git git-lfs tbb ispc openimageio (Restart terminal to update git path) git clone https://github.com/FlorentMasson/IntelOIDenoiser.git Follow instructions at https://www.openimagedenoise.org/downloads.html which are :

git clone --recursive https://github.com/OpenImageDenoise/oidn.git
mkdir oidn/build
cd oidn/build
cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
ccmake ..

Here make sure to set OIDN_APPS_OPENIMAGEIO to ON and CMAKE_OSX_DEPLOYMENT_TARGET to 10.0 image (18) Press c then g

make
cp -r ../include/OpenImageDenoise/* ../../IntelOIDenoiser/contrib/darwin/oidn/include/OpenImageDenoise/
mkdir -p ../../IntelOIDenoiser/contrib/darwin/oidn/lib
cp *.dylib ../../IntelOIDenoiser/contrib/darwin/oidn/lib
cd ../../IntelOIDenoiser
scons

On Apple Silicon we had extra steps

It was not really possible to include all libs along the executable like for windows, as building static libraries is harder on macos and all dynamic libraries come with a full path to dependencies (/usr/local or /opt/homebrew)

@DeclanRussell would you please consider integrating the fixes in main.cpp and changes in SConstruct in this repo? I tried not to break the windows build but I've not tested it. Also for references, I had to use a different version for oidn include files as they contain windows-specific directives that are not supported

DeclanRussell commented 3 years ago

@FlorentMasson Nice work getting this working, its awesome! Thanks a bunch for the detailed build instructions too. I would be more than happy to integrate any changes needed for cross platform support. If you create a pull request, I'll take a look at it 😄

unfa commented 3 years ago

It'd be great to get this working on Linux :)

unfa commented 3 years ago

PS: I got it running. I am trying to denoise photos, but I don't see any visual effect on the images I input.

00:04:630 | Denoising complete in 46.758 seconds

DeclanRussell commented 3 years ago

@unfa Glad to hear you got it working. Unfortunately this denoiser is not designed for photos, only computer generated images. See https://github.com/DeclanRussell/NvidiaAIDenoiser/issues/9 for a similar discussion (though with the Nvidia denoiser that is based on the same technique).