alemart / speedy-vision

GPU-accelerated Computer Vision for JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature matching showing error in for loop.

nurulalamador opened this issue · comments

I am trying to implement Feature matching in for loop but it's showing this error in some loop steps:

Uncaught (in promise) OutOfMemoryError: Out of memory. Exhausted pool (capacity: 1024)
-> [speedy-vision.js]
    at SpeedyTexturePool.allocate (speedy-vision.js:1297:7)
    at SpeedyPipelineNodeImageSource._allocateWorkTextures (speedy-vision.js:1852:30)
    at SpeedyPipelineNodeImageSource.init (speedy-vision.js:1835:58)
    at SpeedyPipeline.init (speedy-vision.js:1929:19)
    at createPipeline (fontlist2.html:327:14)
    at image2.onload (fontlist2.html:178:25)

There are no problems with using tracking.js feature matching in for loop but speedy-vission feature detection is so much better than tracking.js image feature detection that's why I want to use speedy-vission, but facing that problem.

I think I should do something inside createPipeline() function to solve out of memory problem, but what should I do?

How large is your pipeline?

If you're able to share some code, it helps.

Still in need of help?

Still in need of help?

I fixed this problem.
I just increase DEFAULT_CAPACITY in speedy-vision.js.

In line number 8795:
const DEFAULT_CAPACITY = 1024;

I just increased it x10:
const DEFAULT_CAPACITY = 10240;

Although increasing the capacity of the texture pool is a possibility, this may or may not be an efficient solution to your particular issue, depending on your pipeline and on your goals.

Feel free to reach out again if I may be of help to you.