• Stars
    star
    1,972
  • Rank 23,351 (Top 0.5 %)
  • Language
    TypeScript
  • License
    Other
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Fastest DNN Running Framework on Web Browser

WebDNN

ζ—₯本θͺž

This is the alpha version of WebDNN version 2. The main difference between WebDNN 1.x and WebDNN 2.x is that WebDNN 2.x only accepts ONNX models as input, allowing ONNX models to be loaded directly into a web browser without Python preprocessing. In addition, offline model optimization is also possible.

Version 1.x

Supported backends (acceleration technologies)

WebGL is available in most modern browsers.

  • WebGPU
    • The draft version implemented in Chrome Canary.
    • The WebGPU in iOS13 is not supported because it requires shaders based on the deprecated WSL language.
  • WebGL
    • Use WebGL2 if available; also supports Safari, which only supports WebGL1.
  • WebAssembly

Environment setting

The environment which runs node.js 14, python 3.6+ and emscripten 2.0+.

yarn
python setup.py develop

Build

yarn build:all

Build outputs:

  • dist/webdnn.js
    • Library that can load unoptimized ONNX models
  • dist/webdnn-core.js
    • Library that can load optimized ONNX models by WebDNN

Basic usage

Load dist/webdnn.js with the <script> tag to globally add a WebDNN object. Assuming that the ONNX model model_directory/model.onnx exists, and run the model with a input tensor of the 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 the complete minimal code that works.

Test

Generate ONNX models and input/output tensors to be tested

python test/model_test/make_models.py

Run on web browser

yarn server

Open http://localhost:8080/test/model_test/runner/standard.html with web browser, check the backend you want to test, and click the Test button to run the test.

Use

python test/model_test/make_models.py --optimize

http://localhost:8080/test/model_test/runner/optimized.html

when testing, including model optimization. However, the execution time of make_models.py takes a long time.

More Repositories

1

MCD_DA

Python
551
star
2

sushi

The Fastest Matrix Library for JavaScript
JavaScript
122
star
3

NeuralMelody

train and generate melody for pop music with recurrent neural networks
Python
95
star
4

dg_mmld

Pytorch Implementation of Domain Generalization Using a Mixture of Multiple Latent Domains
Python
91
star
5

bc_learning_sound

Chainer implementation of between-class learning for sound recognition https://arxiv.org/abs/1711.10282
Python
90
star
6

sukiyaki

Deep Learning Library for JavaScript
JavaScript
78
star
7

sashimi

Distributed Calculation Framework via Browsers
JavaScript
65
star
8

hyperbolic_nn_plusplus

Official PyTorch implementation of Hyperbolic Neural Networks++
Python
63
star
9

bc_learning_image

Chainer implementation of between-class learning for Image classification https://arxiv.org/abs/1711.10284
Python
62
star
10

sushi2

Matrix Library for JavaScript
JavaScript
60
star
11

tempura

Machine Learning Library for Sushi
JavaScript
47
star
12

sukiyaki2

Deep Learning Library for JavaScript
JavaScript
35
star
13

adr_da

Python
34
star
14

FTGAN

Hierarchical Video Generation from Orthogonal Information: Optical Flow and Texture (AAAI-18)
Python
32
star
15

soba

A visualization toolkit coordinating with Sushi and Tempura
JavaScript
25
star
16

bayes-pcca

MATLAB
12
star
17

vqg-unknown

Python
10
star
18

FSDDIM

Official implementation of Fully Spiking Denoising Diffusion Implicit Models
Python
7
star
19

mil-tokyo.github.io

CSS
6
star
20

distmljs

Distributed Deep Learning Framework for Web
TypeScript
5
star
21

webdnn-data

Metal
5
star
22

coaxials

4
star
23

phrase-length-designated-music-generation

4
star
24

b3_seminar_2017

2017εΉ΄εΊ¦ε°‘δΊΊζ•°γ‚ΌγƒŸ
Jupyter Notebook
3
star
25

neural_network

C
3
star
26

sushilab

JavaScript REPL environment for matrix computing
3
star
27

missing-position-prediction

Jupyter Notebook
2
star
28

mppsc-demo

Missing Position Prediction + Story Completion Demo System
Jupyter Notebook
2
star
29

SharedCharacterStories

This directory contains the Shared-Character Stories dataset and annotations for its subset.
Jupyter Notebook
2
star
30

controllable-story-completion-pilot-study

Source code for our pilot study of controllable story completion task, aiming emotion-aware story writing assistance.
Python
2
star
31

jphacks

JavaScript
1
star
32

DTWL_VL

Python
1
star
33

jphacks-web

PHP
1
star
34

Controlling-semantic-segment-of-motion

Python
1
star
35

SEG_HumanEvaluationReasons

1
star
36

b3seminar2014

Python
1
star
37

youtube_startercode

starter code for YouTube8M competition
1
star