OpenCV in Workers

Hello I’m trying to run opencv in Workers but Workers have limitation to 1MB wasm files. Size of opencv_js.wasm is ~6MB. Is there way how to split this kind of files?

That’s not possible unfortunately, I think they choose to leave it at 1MB for the entire worker including WASM to be able to distribute Workers fast enough globally. I’d guess they will enable larger workers for Enterprise clients in the future though, since it makes sense for many use-cases such as yours.

Oh thank you that was quick. My second idea is build smaller opencv_js.wasm by removing unnecessary modules. Here is link https://answers.opencv.org/question/229032/opencv_jswasm-is-too-large/

Even if you’d be able to run it, current Workers have too little CPU-time to run AI computation.

Workers are meant for back-end web-related workloads, OpenCV seems to need GPU to run efficiently - in other words, it’s mean to run on the browser client.