Name: webdnn
Owner: Machine Intelligence Laboratory (The University of Tokyo)
Description: The Fastest DNN Running Framework on Web Browser
Created: 2017-04-06 08:11:46.0
Updated: 2018-01-18 10:58:16.0
Pushed: 2018-01-18 14:15:01.0
Homepage: https://mil-tokyo.github.io/webdnn
Size: 21673
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
WebDNN is an open source software framework for executing deep neural network (DNN) pre-trained model on web browser.
WebDNN can execute DNN models trained by follow deep learning frameworks on web browser.
v1.2.0
- v1.4.0
)v2.1.3
- )v0.3.0
)v1.23.0
- v3.1.0
)Deep neural network (DNN) is getting much attention to use in many applications. However, it requires a lot of computational resources, and there are many tremendous processes to setup execution environment based hardware acceleration such as GPGPU. Therefore providing DNN applications to end-users is very hard.
WebDNN solves this problem by using web browser as installation-free DNN execution framework. This framework optimizes trained DNN model to compress the model data and accelerate the execution, and executes it with novel JavaScript API such as WebAssembly and WebGPU to achieve zero-overhead execution. Empirical evaluations showed that it achieved more than 200x acceleration.
(1, 299, 299, 3)
for Inception-v3, (1, 224, 224, 3)
for others.Elapsed time per image are shown in vertical axis as logarithmic scale.
WebDNN with WebGPU backend was significantly faster than Keras.js. WebDNN with WebAssembly backend was comparable with GPU backend of Keras.js. In each DNN model and backend, WebDNN obtained better results in terms of speed. More speed improvement is observed when the optimizations are applied in the graph transpiler.
Let's convert and execute ResNet50 pre-trained Keras model[[3]](#3) on your web browser.
First, save ResNet50 pre-trained model provided by Keras.
keras.applications import resnet50
l = resnet50.ResNet50(include_top=True, weights='imagenet')
l.save("resnet50.h5")
Next, convert the model by CLI. In this phase, model is optimized.
on ./bin/convert_keras.py resnet50.h5 --input_shape '(1,224,224,3)' --out output
Then, generated files (called as Descriptor
) can be loaded and executed by JavaScript as follows,
runner, image, probabilities;
c function init() {
// Initialize descriptor runner
runner = await WebDNN.load('./output');
image = runner.inputs[0];
probabilities = runner.outputs[0];
c function run() {
// Set the value into input variable.
image.set(await WebDNN.Image.getImageArray('./input_image.png'));
// Run
await runner.run();
// Show the result
console.log('Output', WebDNN.Math.argmax(probabilities));
WebDNN also supports Caffemodel and Chainer model.
For more information, please see documents.
Please see documents.