-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add blob feature detectors (blob_dog, blob_log, blob_doh) #413
Add blob feature detectors (blob_dog, blob_log, blob_doh) #413
Conversation
…kimage.feature.draw.disk / ellipsoid functins and moved those matrices to gpu with cp.asarray
…s now implemented as cuda / c++ file
…partial implemented
Can one of the admins verify this patch? Admins can comment |
ok to test |
ok to test |
Just leaving a comment to say I have been monitoring this PR (interested in using GPU-accelerated blob detection algorithms from skimage). I have taken an attempt at building cucim using the implementation in this PR, and have found it to provide the speedup I am looking for, at least for blob_log in 3D images. However, I thought it may be useful to note that while the spots' XYZ coordinates for my images are consistent for this implementation and the base skimage method, the sigma values disagree. I am not sure if this is expected due to the difference in implementation or if the functions (esp. prune_blobs) still need some tweaking. Looking forward to seeing this merged with cucim!! |
@vbrow29 Is it possible for you to provide any 3D image data so I can have a look at those sigma values? |
@monzelr sure thing. I am not sure what the best method is for sending the files to you, if you reach out to me at [email protected] I can transfer the files there. Or if preferred, I can create a repo / google drive folder containing the 3D test image I was using and the blob_log parameters. Let me know which is best! |
@vbrow29 : just sent a request via mail |
@vbrow29 : The problem is a kind of error propagation, here a summary:
Overall, I can see that the function I know this is a kind of frustrated answer because the cucim-algorithm is not exactly like the skimage-algorithm, even we use equal-named functions... What you can do to get the right sigma values is to look for blobs with the
sigma_list = cupy.linspace(min_sigma, max_sigma, num_sigma) So basically we have discrete sigma values and every blob detection algorithm returns sigma values from the |
replace 'long long' with INT_T, using 'int' instead when possible
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 again @monzelr, this is looking good now and all tests are passing. We will get this in for the upcoming 2022.12.00 release.
I pushed some minor changes, mainly consisting of:
1.) pep8 / style fixes
2.) declare an INT_T type in the kernels and use int
instead of long long
when possible
3.) memoize the RawKernel generating functions
4.) removed unused kdtree-related code
Thank you @grlee77! |
better to use math operations on tuples directly either numpy or cupy have substantial overhead for working with such small arrays
improves memory efficiency of blob-detection methods
Made a few performance-related changes to:
Initial benchmarking looks great. The results below can be generated running the script in the python cucim_feature_bench.py -f blob_dog -i 3840,2160 -d float32 -t 5 2D resultsSeeing 100x, 132x, and 41x speedups for
3D resultsSeeing >130x speedups for
|
rerun tests |
CI failures are unrelated (apparently related to a new version of CMake released today) |
@gpucibot merge |
Hi again,
due to renaming my branch to
add-blob-detection
, the old PR #411 had been closed.This PR solves issue #398.
Basically, I followed the suggestions by @grlee77 and here is the difference to PR #411:
cupy.asarray
_blob_overlap
is implemented in c++/cuda and not in python anymoreAgain thanks to @annendominik who helped with the implementation.
And also thank you for your help @grlee77 - it is the first time I do a PR in github. ;-)