Skip to content

wasmvision/wasmvision

Repository files navigation

wasmvision-logo

Get going with computer vision

Linux macOS Windows Docker

wasmVision gets you going with computer vision.

It provides a high-performance computer vision processing engine that is designed to be customized and extended using WebAssembly.

How it works

flowchart LR
    subgraph engine
        Capture
        Runtime[WASM Runtime]
        Capture--frame-->Runtime
        Capture<-->OpenCV
        Runtime<-->OpenCV
    end
    subgraph processors
        Runtime--frame-->processor1.wasm
        Runtime--frame-->processor2.wasm
        Runtime--frame-->processor3.wasm
        Runtime--frame-->processor4.wasm
    end
Loading

wasmVision Engine

The wasmVision engine is a standalone binary application for Linux, macOS, or Windows that contains everything you need with no other dependencies.

It is written in the Go programming language using the GoCV Go language wrappers for OpenCV and the Wazero WASM runtime.

See the ARCHITECTURE.md document for more details.

wasmVision Processors

wasmVision processing modules are WebAssembly guest modules that support the wasmCV interface.

Processors can filter images, analyze them, and modify them using traditional computer vision algorithms.

Processors can also use deep neural networks and other machine learning algorithms, and can even download the models they need automatically.

You can use Go, Rust, or the C programming language to write the code for processors.

Want some processors you can try out right away? Take a look at these:

Check out the processors directory for the complete list.

See the PROCESSOR.md document for more information about how processors work and how to develop your own.

Quick start

Linux

Download the latest release for Linux under Releases by clicking on the latest release.

Under "Assets" click on the link for either "wasmvision-linux-amd64" or "wasmvision-linux-arm64" depending on your processor.

Extract the executable to your desired directory.

You might need to set the file as "executable", which you can do from the command line by running chmod +x ./wasmvision in the same directory to which you extracted the wasmvision executable.

Verify wasmVision is installed by running these commands:

cd /path/to/wasmvision/install
wasmvision version

Now you can run a test to capture video using your webcam, blur it using a WebAssembly processor, and then stream the output to port 8080 on your local machine:

wasmvision run -p blur

wasmVision will automatically download the blur.wasm processor from our repo to your local $HOME/processors directory.

Point your browser to http://localhost:8080 and you can see the output.

mjpeg-stream

Want to know more? Please see USING.md

macOS

NOTE: wasmVision currently runs on M-series processors only when using the Homebrew installer. You must install from source to use Intel processors.

Install wasmVision on macOS using Homebrew:

brew tap wasmvision/tools
brew install wasmvision

Verify it is installed like this:

wasmvision version

Now you can run a test to capture video using your webcam, blur it using a WebAssembly processor, and then stream the output to port 8080 on your local machine:

wasmvision run -p blur

wasmVision will automatically download the blur.wasm processor from our repo to your local $HOME/processors directory.

Point your browser to http://localhost:8080 and you can see the output.

Want to know more? Please see USING.md

Windows

Download the latest release for Windows under Releases by clicking on the latest release.

Under the "Assets" click on the link for "wasmvision-windows-amd64".

NOTE: you will likely need to configure your Windows Defender to download the ZIP file with the wasmvision.exe executable.

Extract the executable to your desired directory.

Verify it is installed like this:

chdir C:\path\to\wasmvision\install
wasmvision.exe version

Now you can run a test to capture video using your webcam, blur it using a WebAssembly processor, and then stream the output to port 8080 on your local machine:

wasmvision.exe run -p blur

wasmVision will automatically download the blur.wasm processor from our repo to your local $HOME/processors directory.

You will probably need to configure Windows Firewall to allow the wasmvision.exe executable to access the network port on your local machine.

Point your browser to http://localhost:8080 and you can see the output.

Want to know more? Please see USING.md

Docker

NOTE for macOS users: camera input does not work with Docker on macOS. File sources only.

You can run wasmVision using Docker.

Pull the current development version:

docker pull ghcr.io/wasmvision/wasmvision:main

Verify it is installed like this:

docker run ghcr.io/wasmvision/wasmvision:main version

Now you can run a test to capture video using your webcam, blur it using a WebAssembly processor, and then stream the output to port 8080 on your local machine:

docker run --privileged --network=host ghcr.io/wasmvision/wasmvision:main run -p /processors/blur.wasm

Point your browser to http://localhost:8080 and you can see the output.

Want to know more? Please see USING.md

Development

For information on how to obtain development builds, or work on development for wasmVision itself, please see DEVELOPMENT.md