-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
move the location of fast_exp to help compilation with strange flags #3883
Conversation
Mark, thanks for doing this work. My initial thought is the same as yours:
should we be implementing such low level behavior in scikit-image? Can we
use something from Python or Cython or NumPy or SciPy instead?
|
The counter argument there is that often innovation comes from those who need it. often innovation comes from those who need it. I don't want to inhibit innovation. But I also thing that "speedups" should be quantified and understand that they are very compiler dependent. I don't think it is necessarily wrong to implement such things like this here. I think maybe we can move it to the one file that needs it. I'm getting headaches from pyd and pyx..... The primary goal of this PR is to ensure we are compatible with as many "compiler options" as possible, as demonstrated by a user running Alpine linux which seems to disable some optimization that would otherwise have respected the |
@stefanv see the commit message Further more the discussion here States that we should probably keep the fast_exp function. I think folding fast_exp into the nl_means pyx is probably the best way to ensure correct compilation while respecting the author's contributions. I'll work on that later maybe. |
@blochl i totally didn't see your great PR a while back. I think one the scikit-image policies has been not to include the author names in specific files but rather in the CONTRIBUTORS.txt file. I added a little blurb about your contributation. Mostly I moved this inside the nl_means so that it would work with some strange compilation options. Need to test this on an alpine linux build. But I mostly wanted to let you know that your work wasn't really getting erased. |
|
||
- Leonid Bloch | ||
Implement non-local means restoration. |
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.
I thought NL-means was implemented by @emmanuelle? And git blame corroborates my memory...
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.
Yes, Emma contributed the non-local means function and myself and others have made some improvements over the years.
I would describe the contribution here as "Improvements to the performance and stability of non-local means restoration."
@hmaarrfk would you be able to add a benchmark for NLmeans and report on the results from this PR? |
Apart from the attribution, this looks fine. Another, possibly simpler, solution, would be to leave the |
@hmaarrfk I tried to rebase it, but I got confused about whether these changes actually got partly merged somewhere else, or how they would interact with |
Ping @hmaarrfk
|
closing as likely resolved by the changes in #4322. Please reopen if this is not the case. |
Description
So I rewrote fast_exp as a cython function
#3866
not sure if this is any better or any worse than the previous impelmentation (in terms of speed). This is faster by a good factor of 5. Could be really important as mentioned below for large datasets.
Personally, I think it is some kind of micro-optimization, but I can see where this might be actually helpful consider the restricted range of a uint8 imageWill need to add a benchmark, not too thrilled about doing that at the moment, but I wanted to give somebody a patch to get this working on their "unsupported" architecture.Checklist
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.@meeseeksdev backport to v0.14.x