-
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
Fully-connected 3D CRF #315
Comments
looks really nice, perhaps could start with the pure pytorch version? we haven't figured out how to package/distribute cuda kernels in monai. (have you tried to contribute the kernels to pytorch directly?) |
@wyli yes starting with the pure PyTorch version in the folder PAM sounds good. As a motivation for future integration of the cuda code, I have measured that the CRF with cuda version is 5x faster than the pure PyTorch version on my machine at inference for a volume 136x136x136. Regarding the cuda kernels integration I will let @SamuelJoutard reply as he is the expert on this. |
@wyli No I did not try to submit the kernel to Pytorch because the HashTable is not dynamically allocated in terms of memory (the kernel operates on a pre-allocated "relatively large" amount of memory) and this could be improved in my opinion. In addition to the speed-up @LucasFidon mentioned, the Cuda version properly handles collisions in the HashTable which could marginally improve the results. |
This issue hinges on #785 |
as #785 is now fixed, do you want to revisit this ticket? @LucasFidon @SamuelJoutard? currently (as of monai v0.3) in a git-cloned MONAI codebase, running:
|
@charliebudd will be able to help. |
bilateral filtering merged #1375, As discussed with @charliebudd, optional todos are:
|
@charliebudd Following our discussion earlier, it would be good to double check the status of the CRF code in MONAI. If it's finalised already, you can close this issue. In any case, it would be good to have a demo notebook for it. Not sure if it fits in MONAI proper or in For the record, we had a similar notebook in NiftyNet already that could be ported (unless you have better ideas of course): |
Hey @charliebudd, I was wondering if you are looking into the tutorial mentioned by @tvercaut ? If it is still open for contribution then perhaps I can help convert the NiftyNet tutorial to use MONAI's CRF implementation. |
I just set up a draft PR with the notebook in... Project-MONAI/tutorials#170. The CRF is not currently in the released version of monai which the tutorials use. |
feature request: CRF Post Processing as a MONAI Transform (from @masadcv #2196) Is your feature request related to a problem? Please describe. Describe the solution you'd like Describe alternatives you've considered Additional context
Example usage of above as post processing would be:
Please let me know your thoughts about this, whether it makes sense to have as a Transform? If so, I am happy to work on this. |
close merged |
Is your feature request related to a problem? Please describe.
3D CRF have been widely used as post-processing in segmentation applications.
Describe the solution you'd like
We have made publically available an implementation of a fully-connected 3D CRF in PyTorch:
https://github.com/SamuelJoutard/Permutohedral_attention_module
This could be added directly to MONAI.
The 3D CRF itself is based on the existing implementation in NiftyNet, and it relies on an efficient implementation of gaussian filtering in cuda. Our implementation is several times faster than the NiftyNet implementation.
The text was updated successfully, but these errors were encountered: