creotiv / hdrnet-pytorch

Unofficial PyTorch implementation of 'Deep Bilateral Learning for Real-Time Image Enhancement', SIGGRAPH 2017 https://groups.csail.mit.edu/graphics/hdrnet/
220 stars 43 forks source link

about biliteral_slice question #23

Closed alexliyang closed 2 years ago

alexliyang commented 2 years ago

hi, I trained the model ,and use c++ to infer . in order to do this job . I split the model to two models : biliteral_grid model and guide model. then I can get two infer result: coeffs and guidemap. then I use C++ biliteral_slice op two do slice and applycoeffs , but the result is different from the whole model infer result. just part of image is right, others part color is very bad and strange.

I can't understand why ?

ops/ bilateral_slice.cu.cc C++ code is equal to F.grid_sample ?

alexliyang commented 2 years ago

hdrnet_outtorchs

creotiv commented 2 years ago

@alexliyang F.grid_sample and bilateral slice not equal. They seems do same stuff, but how they do this internally is a question. And that's a problem, cause somehow model with grid_sample don't want to learn, maybe grid_sample use some logic that breaks gradient for correct passing.

if you want to use cuda code, better to download latest one from original repo https://github.com/google/hdrnet

alexliyang commented 2 years ago

thank you very much , now I compile the C++ op, then training again , useing C++ version infer is OK

creotiv commented 2 years ago

I also added jit compiled version of bilateral slice from original repo. just in case