halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.83k stars 1.07k forks source link

Local laplacian gradient does not work #8393

Open mshafiei opened 3 weeks ago

mshafiei commented 3 weeks ago

Hi,

I'm trying to get the gradient of local laplacian generator. When I add GRADIENT_DESCENT_OPT "GRADIENT_DESCENT" to python_bindings/apps/CMakeLists.txt:48 the local laplacian app breaks. The output image turns out to be pitch black. Also the gradient image is black (you need to add an additional buffer as the last parameter list of the generator in the local_laplacian_app.py). Is there any workaround for this issue?

abadams commented 3 weeks ago

Sounds like something is broken, but before investigating I wanted to point out that the gradient w.r.t. the input image is going to be zero for that algorithm anyway, because it starts with a nearest-neighbor-sampled lookup table.

mshafiei commented 3 weeks ago

I'm actually interested in the derivative w.r.t. alpha. I think that doesn't rely on the nearest neighbor look up. Is that correct? I also tried gradient on other generators e.g. blur, bilateral grid but none of them seem to work.