Need help with webml-polyfill?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

132 Stars 42 Forks Apache License 2.0 1.5K Commits 327 Opened issues


A polyfill for Web Neural Network (WebNN) API

Services available


Need anything else?

Contributors list

Web Machine Learning

Web Neural Network (WebNN) API polyfill and examples

A polyfill for Web Neural Network (WebNN) API with computer vision and natural language processing examples.

The Web Neural Network (WebNN) API is a dedicated low-level API for neural network inference hardware acceleration. It is worked on in the W3C Machine Learning for the Web Community Group.

Project Build Status


Linux Windows
Build Status CircleCI Build status


WebNN API Examples QR Code

Supported Backends

  • Polyfill
    • WASM: TensorFlow.js WebAssembly backend builds on top of the XNNPACK library
    • WebGL: TensorFlow.js GPU accelerated WebGL backend
    • WebGPU: WIP
  • WebNN: Web Neural Network (WebNN) API

Run example with hardware accelerated WebNN backend

If you are interested, please refer to WebNN Chromium build repo and WIKI:


  • Web AI Workload Use this tool to collect the performance-related metrics (inference time, etc) of various models and kernels on your local device with Wasm, WebGL, or WebNN backends. The Web AI Workload also supports to measure the OpenCV.js DNN performance with Wasm, Wasm Threads and Wasm SIMD.
  • OpenCV.js Performance Test Use this tool to collect the OpenCV.js performance for image processing with Wasm, Wasm Threads and Wasm SIMD.

Building & Testing


$ npm install


$ npm start

Start an HTTPS server

$ HTTPS=true npm start


$ npm run build

Production build

$ NODE_ENV=production npm run build

WASM backend build:

$ npm run build-wasm


$ npm start

Open browser and navigate to http://localhost:8080/test


$ npm run watch


This project is following Apache License Version 2.0.

Documents in test/wpt/resources are licensed by the W3C 3-clause BSD License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.