rapidsai / cucim

cuCIM - RAPIDS GPU-accelerated image processing library
https://docs.rapids.ai/api/cucim/stable/
Apache License 2.0
356 stars 61 forks source link

Fix a couple of performance issues in `peak_local_max` (improve performance of blob detectors and `corner_peaks`) #782

Closed grlee77 closed 2 months ago

grlee77 commented 2 months ago

It seems that we can get a large speedup in calls to peak_local_max when the default min_distance=1 is specified. A bottleneck in that function can be the call to ensure_spacing which falls back to the CPU, but we don't need to call that function at all unless min_distance>1 (no coordinates can be excluded if min_distance=1, so it is pointless to call it).

I proposed the same changes upstream in https://github.com/scikit-image/scikit-image/pull/7548. See additional comments and measurements made there.

There should be no change in behavior with this MR, it is purely a performance improvement.

grlee77 commented 2 months ago

/merge