<div>Hi Thomas</div><div>I know local_max has no tolerance, And peak_local_max has some parameter based on distance and abs value,(which the watershed demo in gallery used, but when the area is complex, the result is very massy). the h_max is what I need, but the result is unexpected somewhere, and It is too slow (the same image h_max cost 2.6s, but I wrote in numba cost 0.1s)</div><div><br></div><div>May I start a new topic thread? with the test image, and my numba code.</div><div><br></div><div>Best</div><div>YXDragon</div><div id="origbody"><div style="background: #f2f2f2;">----- 原始邮件 -----<br>发件人:Thomas Walter via scikit-image <scikit-image@python.org><br>收件人:scikit-image@python.org<br>抄送人:Thomas Walter <Thomas.Edgar.Walter@googlemail.com><br>主题:Re: [scikit-image] 回复: Numba on pypi<br>日期:2017年07月13日 16点25分<br></div><br>
  
  
    <div class="">Hi YXDragon, <br>
      <br>
      just a word on some aspect you mention: <br>
      <br>
      > the local_max has not a tolerance, so the result is too
      massy, then do a watershed end with too many fragments...,
      <br>
      <br>
      The definition that underlies this function is: "A local maximum
      is a region of constant grey level strictly greater than the grey
      levels of all pixels in direct neighborhood of the region." -
      There is no tolerance associated to this definition, and I am
      perfectly fine with this. There are definitely many cases where
      you want to extract all local maxima. Nevertheless, there are
      other functions for detection of maxima that allow one to also
      impose certain criteria (such as h_maxima or peak_local_max).<br>
      <br>
      A question to Stéfan: would this mean that you would remove all
      cython code from scikit-image or would numba just be another
      option? <br>
      <br>
      Best, <br>
      <br>
      Thomas. <br>
      <br>
      On 7/13/17 8:49 AM, <a target="_blank" class="" href="mailto:imagepy@sina.com">imagepy@sina.com</a> wrote:<br>
    </div>
    <blockquote cite="mid:20170713064912.63C55B000D7@webmail.sinamail.sina.com.cn" type="cite">
      <div>Hi Stéfan:</div>
      <div><br>
      </div>
      <div>  I appreciate Numba. for sometimes, we must do a 'for' in
        our python code, but just a 'for' with a 'if', It is fussy to
        compile a so/dll or write cython. Numba is very portable, and
        can run anywhere, just need to install numba and llvmlite. (That
        means our package could be a light-weight library, undepended
        any native so/dll)</div>
      <div><br>
      </div>
      <div>  As I metioned befor, many scikit-image's algrisms are
        not exquisite enough(just my own opinion),</div>
      <div>      the mid_axi function results too many branch and
        sometimes with hols,  </div>
      <div>      the local_max has not a tolerance, so the result is too
        massy, then do a watershed end with too many fragments...,</div>
      <div>      and how to build a graph from the skeleton, then do a
        network analysis.</div>
      <div><br>
      </div>
      <div>I want to do a contribute to scikit-image, But after some
        effort, I give up, I prefor to write a dynamic lib rather then
        Cython. In the end, I wrote them in Numba. So I appreciate to
        use Numba.</div>
      <div><br>
      </div>
      <div>Best</div>
      <div>YXDragon</div>
      <div><br>
      </div>
      <div id="origbody">
        <div style="background: #f2f2f2;">----- 原始邮件 -----<br>
          发件人:Stefan van der Walt <a target="_blank" class="" href="mailto:stefanv@berkeley.edu"><stefanv@berkeley.edu></a><br>
          收件人:<a target="_blank" class="" href="mailto:scikit-image@python.org">scikit-image@python.org</a><br>
          主题:[scikit-image] Numba on pypi<br>
          日期:2017年07月13日 14点17分<br>
        </div>
        <br>
        Hi everyone,<br>
        As many of you know, speed has been a point of contention in<br>
        scikit-image for a long time. We've made a very deliberate
        decision to<br>
        focus on writing high-level, understandable code (via Python and<br>
        Cython): both to lower the barrier to entry for newcomers, and
        to lessen<br>
        the burden on maintainers. But execution time comparisons, vs
        OpenCV<br>
        e.g., left much to be desired.<br>
        I think we have hit a turning point in the road. Binary wheels
        for<br>
        Numba (actually, llvmlite) were recently uploaded to PyPi,
        making this<br>
        technology available to users on both pip and conda
        installations. The<br>
        importance of this release on pypi should not be dismissed, and
        I am<br>
        grateful to the numba team and Continuum for making that
        decision.<br>
        So, how does that impact scikit-image? Well, imagine we choose
        to<br>
        optimize various procedures via numba (see Juan's blog post for
        exactly<br>
        how impactful this can be:<br>
<a target="_blank" class="" href="https://ilovesymposia.com/2017/03/15/prettier-lowlevelcallables-with-numba-jit-and-decorators/">https://ilovesymposia.com/2017/03/15/prettier-lowlevelcallables-with-numba-jit-and-decorators/</a>).<br>
        The only question we have to answer (from a survival point of
        view)<br>
        needs to be: if, somehow, something happens to numba, will an<br>
        alternative will be available at that time? Looking at the
        Python JIT<br>
        landscape (which is very active), and the current state of numba<br>
        development, I think this is likely. And, if we choose to use
        numba, of<br>
        course we'll help to keep it healthy, as far as we can.<br>
        I'd love to hear your thoughts. I, for one, am excited about the<br>
        prospect of writing kernels as simply as:<br>
        >>> @jit_filter_function<br>
        ... def fmin(values):<br>
        ... result = np.inf<br>
        ... for v in values:<br>
        ... if v < result:<br>
        ... result = v<br>
        ... return result<br>
        >>> ndi.generic_filter(image, fmin, footprint=fp)<br>
        Best regards<br>
        Stéfan<br>
        _______________________________________________<br>
        scikit-image mailing list<br>
        <a target="_blank" class="" href="mailto:scikit-image@python.org">scikit-image@python.org</a><br>
        <a target="_blank" class="" href="https://mail.python.org/mailman/listinfo/scikit-image">https://mail.python.org/mailman/listinfo/scikit-image</a><br>
      </div>
      <br>
      <fieldset class=""></fieldset>
      <br>
      <pre wrap="">_______________________________________________
scikit-image mailing list
<a target="_blank" class="" href="mailto:scikit-image@python.org">scikit-image@python.org</a>
<a target="_blank" class="" href="https://mail.python.org/mailman/listinfo/scikit-image">https://mail.python.org/mailman/listinfo/scikit-image</a>
</pre>
    </blockquote>
    <br>
    <p><br>
    </p>
    <pre class="" cols="72">-- 
Thomas Walter
27 rue des Acacias
75017 Paris</pre>
  


_______________________________________________<br>scikit-image mailing list<br>scikit-image@python.org<br>https://mail.python.org/mailman/listinfo/scikit-image<br></div>