Giter Club home page Giter Club logo

Comments (7)

qiuhan96 avatar qiuhan96 commented on July 3, 2024

Just test how long it will take to use scipy's in-built functionality to find pairs. For 120000 sub image pixels and 5000 source pixels, the time cost for pairing (building the Delaunay and finding pairs for all sub image pixels) is only ~ 0.05s for one cpu. The major cost is next step which is to compute the weight of each point. It takes ~ 4s. So probably we can just use the scipy built-in function to find pairs but for the weight computing part we need to use numba to speed it up. If we choose to use scipy built-in functionality, do we still need to compute pixelization_index_for_voronoi_sub_slim_index_from?

from pyautolens.

Jammy2211 avatar Jammy2211 commented on July 3, 2024

That is extremely fast for pairing! I would expect the function pixelization_index_for_voronoi_sub_slim_index_from to take > 5 seconds for that number of image / source pixels. There must be a geometric exploit for a Delaunay that speeds this up a lot compared to the Voronoi (for a Rectangular grid this process is extremely fast).

I would imagine that the SciPy computation of interpolation weights is as good as we can hope for in terms of run time. Its a very well optimized library. What are the run times for 30000 / 60000 / 120000 / 240000 sub-pixels and 1500 / 2500 source pixels?

from pyautolens.

qiuhan96 avatar qiuhan96 commented on July 3, 2024

sub_pixels | source_pixels | pairing time | weight time
65000 2600 0.03 1.8
125000 2600 0.03 4.6
215000 2600 0.03 7.1

65000 1500 0.02 1.8
125000 1500 0.02 3.8
215000 1500 0.03 7.3

The part computing the weights is written by myself and they are pure python scripts, so it's slow.

from pyautolens.

Jammy2211 avatar Jammy2211 commented on July 3, 2024

Ah, that is good news! Sounds like this can be lightning fast, once we speed up the weights.

Can you use this to get the weights efficiently?

https://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.interpolate.LinearNDInterpolator.html

from pyautolens.

qiuhan96 avatar qiuhan96 commented on July 3, 2024

Ah! Thanks! Didn't expect scipy actually implemented Delaunay interpolation. Will try to build it in.

from pyautolens.

qiuhan96 avatar qiuhan96 commented on July 3, 2024

Complied the weighting part with Numba, now with 125000 sub pixels and 5000 source pixels, the time cost for weighting computation is ~ 0.3 s (using one core) on my computer. Is this speed acceptable?

from pyautolens.

Jammy2211 avatar Jammy2211 commented on July 3, 2024

Amazing, signifcantly faster overall than the non interpolated Voronoi 🥳

from pyautolens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.