Open archibate opened 3 years ago
Thanks! We don't have Python bindings on our roadmap yet but feel free to submit a pull request to OpenImageDenoise/oidn. However, I can't promise anything regarding when we could actually integrate it. We're currently focusing on GPU support, so the integration could happen only sometime after the next major release.
@archibate did you end up implementing such a thing? I would indeed be interested. Otherwise, is the python code in "training/" sufficient to denoise images in python? Many thanks.
did you end up implementing such a thing? I would indeed be interested.
@AJSVB Actually I've already abandoned that renderer project now...
Otherwise, is the python code in "training/" sufficient to denoise images in python?
I guess these are just training scripts for OIDN developers, rather than denoising script for end-users.
If you'd like to set up Python binding on your own, here's the information:
Python can actually directly load and invoke C functions in .dll
or .so
files, by using ctypes
module, e.g.:
import ctypes
dll = ctypes.CDLL.LoadLibrary('YourCompiledOIDNLibrary.so')
device = dll.oidnNewDevice(12345)
dll.oidnCommitDevice(device)
Here's some Python/C++ binding code I'm recently working on: https://github.com/zenustech/zeno/blob/a649ea9465f0cbc9fda632c60559fe043927ef40/projects/Python/Lib/ze/__init__.py
We may also define argument and return types manually to avoid type mismatch: https://github.com/zenustech/zeno/blob/a649ea9465f0cbc9fda632c60559fe043927ef40/projects/Python/Lib/ze/__init__.py#L37-L53
Wow, thank you for this fast response, I will take a look :)
I would really like a python version of this as well. @AJSVB have you made any progress? If I have time I could try having a run at it.
I have a low-key working solution for inference only: I downloaded the precompiled oidn denoiser, and I do command line calls from os.system in python.
Hi, thank for the cool project! I'd like to invoke OIDN from Python, so that my renderer project can denoise the noisy images it generates without requiring any line of C++ code. I believe other peoples might also have such need, so instead of writting C++/Python bindings just for myself, I want to contribute it to somewhere like OpenImageDenoise/pyoidn🤣 To expose Python bindings, we may use pybind11 to wrap our C++11 API. I'll be glad to help!