GithubHelp home page GithubHelp logo

Comments (4)

gau-nernst avatar gau-nernst commented on September 22, 2024

I recently had to implement warp_affine from scratch in Dart to do image transformation in Flutter without OpenCV. I could contribute warp_affine here if you are okay with that. It's probably not gonna be super fast.

grid_sample is not needed. The current bilinear_interpolation() function should be enough.

from kornia-rs.

edgarriba avatar edgarriba commented on September 22, 2024

feel free to go for it -- about grid_sample, it will basically a way to reuse code. If you see in the resize_native function the ndarray::Zip is basically parallelizing over the destination points. In any case you will have to reimplement that to make it efficient, we don't want regular looping but instead iterators (which is what's happening in that code already.

from kornia-rs.

gau-nernst avatar gau-nernst commented on September 22, 2024

Interesting. Do you have benchmarks between naive for-loop version and the current version?

Some observations

  • Currently we materialize the whole index array (width x height). This is quite wasteful.
  • There is probably overhead for parallelization (from what I see, ndarray uses rayon https://docs.rs/ndarray/latest/ndarray/parallel/index.html). Perhaps we can parallelize over the rows only instead of all the points to reduce overhead.

In any case, let's get a working implementation first before looking more into the speed.

from kornia-rs.

edgarriba avatar edgarriba commented on September 22, 2024

done

from kornia-rs.

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.