1198 efficient differentiable bilateral filter#1375
1198 efficient differentiable bilateral filter#1375charliebudd merged 57 commits intoProject-MONAI:masterfrom charliebudd:1198-efficient-differentiable-bilateral-filter
Conversation
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
… passing, implementation from https://github.com/SamuelJoutard/Permutohedral_attention_module Signed-off-by: charliebudd <[email protected]>
… some data to process Signed-off-by: charliebudd <[email protected]>
…ode currently untested due to windows build issues, implementation from https://github.com/SamuelJoutard/Permutohedral_attention_module Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
…98-efficient-differentiable-bilateral-filter
Signed-off-by: charliebudd <[email protected]>
…s caused on windows Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
Signed-off-by: charliebudd <[email protected]>
|
/black |
Signed-off-by: charliebudd <[email protected]>
wyli
left a comment
There was a problem hiding this comment.
thanks @charliebudd this is very nice, would be great to have a short notebook demo
|
Hi @charliebudd , I get problems with the save_for_backward function, as it does not accept the filter parameters (I think save_for_backward is actually made for storing the input tensor and not for the parameters): Wouldn't it be easier to implement the bilateral filter class as a nn.Module instead of torch.autograd.Function (like, e.g., the Gaussian filter)? Then, one could store the parameters in an instance variable. Thanks for your help! |
|
I just recognized, you can just assign the parameters directly to ctx instead of using save_for_backward. E.g., like Then the layer at least does not throw an error. |
|
Indeed, thanks for pointing out this out. I have made the changes and have drafted a PR #1888. Sorry for the error. |
|
Thank you so much! |
Fixes #1198 .
Description
Adds two bilateral filter algorithms to the c++ extention module. Each have both a cpu and a cuda implementation.
One works by a bruteforce kernel, the other using a more refined approximate solution presented here...https://graphics.stanford.edu/papers/permutohedral/
The desired implementation is chosen via a boolean flag at the python interface level.
There are improvements which could be made but this is long overdue and already a very large PR.
There are also two issues I'm aware of but both are imperceptible at normal scales...
Status
Ready
Types of changes
./runtests.sh --codeformat --coverage../runtests.sh --quick.make htmlcommand in thedocs/folder.