랭킹으로 돌아가기

mil-tokyo/webdnn

TypeScriptmil-tokyo.github.io/webdnn

The Fastest DNN Running Framework on Web Browser

deep-neural-networksaccelerateoptimizationjavascriptwebgpu
스타 성장
스타
2k
포크
149
주간 성장
이슈
0
5001k1.5k2k
2017년 5월2020년 5월2023년 6월2026년 7월
아티팩트npmnpm install webdnn
README

WebDNN

日本語

WebDNN version 2 runs neural network inference directly in the web browser. The major difference from WebDNN 1.x is that WebDNN 2.x accepts ONNX models as input, allowing an ONNX model to be loaded straight into the browser without Python preprocessing. Offline model optimization is also available.

Version 1.x

Supported backends (acceleration technologies)

  • WebGPU — current WGSL-based implementation. Works on modern Chrome / Edge (and on Safari / Firefox where WebGPU is enabled).
  • WebGL — uses WebGL2 when available, with a WebGL1 fallback.
  • WebAssembly — requires an emscripten build of the kernels. See docs/emscripten-setup.md.

Environment

  • Node.js 20+ (see .nvmrc)
  • Python 3.10+ via uv — only needed for model optimization and generating test fixtures
  • emscripten 3.1+ — only needed to build the WebAssembly backend

Setup

npm install
uv sync            # only if you use the Python graph transpiler / optimizer

Build

npm run build:all

Build outputs (in dist/):

  • dist/webdnn.js — UMD bundle (global WebDNN) that loads unoptimized ONNX models
  • dist/webdnn-core.js — loads ONNX models optimized offline by WebDNN
  • dist/op-*.js — operator bundles, loaded dynamically at runtime
  • dist/types/ — TypeScript type declarations

build:all runs WGSL shader generation (shader:webgpu) and operator-entry generation (makeShaderList, requires Python 3) before the Vite build. The WebAssembly backend is not built by build:all; building it requires emscripten (see docs/emscripten-setup.md).

Basic usage

Load dist/webdnn.js with a <script> tag to add a global WebDNN object. Assuming the ONNX model model_directory/model.onnx exists, run it with an input tensor of shape [1, 2]:

const runner = await WebDNN.load("model_directory/");
const inputDataArray = new Float32Array([5.1, -2.3]);
const inputTensor = new WebDNN.CPUTensor([1, 2], "float32", inputDataArray);
const [outputTensor] = await runner.run([inputTensor]);

console.log(outputTensor.data); // Float32Array

See example/minimum for a complete minimal working example.

Test

See docs/testing.md for the full testing guide.

npm test            # unit tests (vitest, no GPU required)
npm run fixtures    # generate ONNX test fixtures (uv, Python)
npm run test:e2e    # Playwright E2E (CPU / WebGPU / WebGL, automated)
npm run server      # static server for the manual browser runner

For the manual browser runner, open http://localhost:8080/test/model_test/runner/standard.html, check the backend you want to test, and click the Test button.

npm run fixtures generates the ONNX models and input/output tensors used by the tests. (The legacy test/model_test/make_models.py, which depends on PyTorch, remains only for large-model generation and is not part of the standard flow.)

관련 저장소
tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone

C++Apache License 2.0tensorflowmachine-learning
tensorflow.org
196.5k75.7k
deepfakes/faceswap

Deepfakes Software For All

PythonPyPIGNU General Public License v3.0faceswapface-swap
faceswap.dev
55.4k13.4k
terryum/awesome-deep-learning-papers

The most cited deep learning papers

TeXdeep-learningdeep-neural-networks
26.2k4.4k
HarisIqbal88/PlotNeuralNet

Latex code for making neural networks diagrams

TeXMIT Licenselatexdeep-neural-networks
24.9k3.1k
spmallick/learnopencv

Learn OpenCV : C++ and Python Examples

Jupyter Notebookcomputer-visionmachine-learning
learnopencv.com
23k11.7k
onnx/onnx

Open standard for machine learning interoperability

PythonPyPIApache License 2.0deep-learningdeep-neural-networks
onnx.ai
21.2k4k
iperov/DeepFaceLab

DeepFaceLab is the leading software for creating deepfakes.

PythonPyPIGNU General Public License v3.0faceswapface-swap
19.3k919
ujjwalkarn/Machine-Learning-Tutorials

machine learning and deep learning tutorials, articles and other resources

Creative Commons Zero v1.0 Universaldeep-learning-tutorialmachine-learning
ujjwalkarn.github.io/Machine-Learning-Tutorials
18k4k
microsoft/CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit

C++Othercognitive-toolkitcntk
docs.microsoft.com/cognitive-toolkit/
17.6k4.2k
alphacep/vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node

Jupyter NotebookApache License 2.0speech-recognitionasr
15k1.7k
kmario23/deep-learning-drizzle

Drench yourself in Deep Learning, Reinforcement Learning, Machine Learning, Computer Vision, and NLP by learning from these exciting lectures!!

HTMLmachine-learningdeep-learning
deep-learning-drizzle.github.io
12.9k3k
ritchieng/the-incredible-pytorch

The Incredible PyTorch: a curated list of tutorials, papers, projects, communities and more relating to PyTorch.

MIT Licensepytorchpython
12.6k2.2k