For decades, web browsers were essentially just document viewers. Today, they are powerful virtual machines capable of running complex artificial intelligence models.
At LensText, our tools like the Background Remover and OCR Engine rely on this breakthrough technology.
What is WebAssembly (WASM)?
JavaScript is the native programming language of the web, but it wasn't designed for heavy mathematical computations. WebAssembly (WASM) is a low-level binary instruction format. It allows developers to write code in languages like C++, Rust, or Go, and compile it into a format that runs inside the browser at near-native speeds.
Enter ONNX
ONNX (Open Neural Network Exchange) is an open-source format for AI models. It allows models trained in frameworks like PyTorch or TensorFlow to be exported to a standardized format.
Putting It Together
When you use the Background Removal Tool on LensText:
- Your browser downloads a highly optimized ONNX model (the "brain" that knows what a human looks like vs. a background).
- We use an ONNX Runtime compiled into WebAssembly to execute the model.
- The WASM engine utilizes your computer's WebGL (Graphics API) to hardware-accelerate the math.
- The background is removed locally on your GPU!
This architecture ensures that highly complex AI operations can be performed securely, privately, and for free, as we don't have to pay for expensive cloud GPU servers to process your images.