Giter Site home page Giter Site logo

wasm support about ssim HOT 4 CLOSED

obartra avatar obartra commented on June 15, 2024
wasm support

from ssim.

Comments (4)

obartra avatar obartra commented on June 15, 2024

Oh hey there thanks for the interest! I don't have experience with wasm but I'm all for trying it if we can add node and browser support.

Before we go down that path though, have you tried the bezkrovny version (see options)?

Another option that will dramatically improve performance is downsampling the image.

For the test images you are using I usually get the opposite results on a similar machine (reading the image taking ~100ms and ssim about ~30ms) any chance these values are flipped?

from ssim.

lonelyclick avatar lonelyclick commented on June 15, 2024

I tried options, but the performance on the iPhone 8 plus is still not good. If bezkrovny is set, the accuracy is not enough, so it is necessary to improve the performance. Can we try wasm or webgl, and switch conveniently?

const { mssim, performance } = ssim(imageData, this.imageData, {
  ssim: 'fast',
  downsample: 'fast',
});

console.log(`SSIM: ${mssim} (${performance}ms)`);
  • iPhone 8 Plus
  • image width and height: 320px
  • time: 50ms~

from ssim.

obartra avatar obartra commented on June 15, 2024

Got it, yeah bezkrovny won't give the same results although it correlates fairly well with perceived image degradation as well, I talked about it more here

I've updated the node/web example to give more info on the different performances and generated values.

But if you've tried all this and the results and / or performance are still not good enough, let's look into other options.

I had tried a previous implementation with typed arrays but didn't get the performance boost I expected (operations were faster but array creation was slower so it ended up being a wash) so I suspect webgl won't give us much gain but I could be wrong.

Would you be interested in taking a crack at a wasm or webgl implementation? I can help but I don't have enough bandwidth to own the full implementation at the moment

from ssim.

obartra avatar obartra commented on June 15, 2024

I've looked into adding wasm support but it'd take more time than I can dedicate to it right now.

I'll go ahead and close this issue since I'm not actively working on it but feel free to create a new one if you want to take a crack it

from ssim.

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.