alemart / speedy-vision

GPU-accelerated Computer Vision for JavaScript.
Apache License 2.0
175 stars 28 forks source link

Feature matching showing error in for loop. #37

Closed nurulalamador closed 2 years ago

nurulalamador commented 2 years ago

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?

alemart commented 2 years ago

How large is your pipeline?

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

alemart commented 2 years ago

Still in need of help?

nurulalamador commented 2 years ago

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;

alemart commented 2 years ago

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.