-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1198 efficient differentiable bilateral filter #1375
1198 efficient differentiable bilateral filter #1375
Conversation
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
… passing, implementation from https://github.com/SamuelJoutard/Permutohedral_attention_module Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
… some data to process Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
…ode currently untested due to windows build issues, implementation from https://github.com/SamuelJoutard/Permutohedral_attention_module Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
…98-efficient-differentiable-bilateral-filter
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
…s caused on windows Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
/black |
Signed-off-by: charliebudd <charles.budd@kcl.ac.uk>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 html
command in thedocs/
folder.