Paddle.js is a web project for Baidu PaddlePaddle, which is an open source deep learning framework running in the browser. Paddle.js can either load a pre-trained model, or transforming a model from paddle-hub with model transforming tools provided by Paddle.js. It could run in every browser with WebGL/WebGPU/WebAssembly supported. It could also run in Baidu Smartprogram and WX miniprogram.
uniform
field to support passing values for uniform variables in operators' shader program.interpType
field to support configurable data interpolation type(LINEAR
or NEAREST
, default is NEAREST
) when use webgl backend.webgl_gpu_pipeline
or webgl_feed_process
)Optimize model structure and reduce redundant model parameters.
connect
op to match the support of multipul outputs cases.Paddle.js v2.0 全面支持 Paddle 2.0 模型推理,并进行了架构升级。同时,预测性能相对 1.0 版本有较大提升,支持数据 4 通道排布,支持 WebGPU、NodeGL 和 Cpu 多种计算加速方案。支持了更多模型结构和算子类型。
通过缩减代码规模和进一步拆分和封装,让子模块都能够完整地工程化,从而提升 Paddle.js 的可维护性和代码质量,提升研发效率,降低使用门槛
paddlejs-models
和工具包 paddlejs-mediapipe
,提供简单 api,整体上提升 Paddle.js 易用性paddlejs-backend-webgl
算子和模型转换工具 paddlejs-converter
适配 Paddle 2.0preTransform
、transform
和 postTransform
,便于对对特殊模型结构进行变换处理相对于 1.0 版本 Paddle.js 在 WebGL backend下,模型性能有较大提升: MobileNetV2 在 webgl 1.0 环境下 预测耗时性能提升 40%;在 webgl 2.0 环境下 预测耗时性能提升 39.6%。
PC浏览器: Chrome、Safari、Firefox 手机浏览器: Baidu App、Safari、Chrome、UC and QQ Browser 小程序: 百度小程序、微信小程序 系统: MacOS、Windows
MobileNetV1 MobileNetV2 MobileNetV3 ShuffleNetV2 ssd-MobileNetV3 GhostNet HRNet_w18_small_v1
arg_max arg_min elementwise_mul elementwise_div unsqueeze2 fc dropout hard_sigmoid sigmoid matmul clip flatten_contiguous_range greater_than reduce_sum where pow sqrt
Paddle.js v2.0.0 fully supports Paddle v2.0. It implements architecture upgradation and separation. Compared with v1.0.0, the performance has been greatly improved. It supports texture packing and adds WebGPU, NodeGL, Cpu, NodeGL backends. More model structures and operator types are supported.
This release contains a number of breaking changes, details of which are listed below:
Improve maintainability and code quality of Paddle.js by reducing code size and further splitting / packaging, so that sub-modules can be fully engineered, improving R&D efficiency and lowering the barrier to use.
Disassembled offline and online modules, decouple the main frame runtime and backend modules. Each module can be iterated independently. Organized the large codebases into monorepos.
Provide unified engineering specification constraints, and each package can be used individuality.
Support texture packing and reduce I/O operations to improve performance.
Package model library paddlejs-models
and toolkit paddlejs-mediapipe
. Provide simple api and better usability of Paddle.js.
Some operators are newly added or upgraded in Paddle v2.0, and model conversion tool paddlejs-converter
is upgraded in Paddle v2.0.
Add benchmark tool to analyze model inference time to help performance optimization.
Support transform-mechanism
, including preTransform
, transform
and postTransform
, which helps users transform special model structure conveniently.
Compared with v1.0.0, the performance has been greatly improved.
Optimized MobileNetV2 (speedup 40% in WebGL 1.0, 39.6% in WebGL 2.0)
PC: Chrome, Safari, Firefox Phone: Baidu App, Chrome, UC and QQ Browser Smartprogram: Baidu Smartprogram, WX Smartprogram Platform: macOS, Windows
MobileNetV1 MobileNetV2 MobileNetV3 ShuffleNetV2 ssd-MobileNetV3 GhostNet HRNet_w18_small_v1
arg_max arg_min elementwise_mul elementwise_div unsqueeze2 fc dropout hard_sigmoid sigmoid matmul clip flatten_contiguous_range greater_than reduce_sum where pow sqrt
Paddle.js是百度Paddle的web方向子项目,是一个运行在浏览器中的开源深度学习框架。Paddle.js可以加载训练好Paddle.js模型,或者将Paddle.fluid模型通过Paddle.js的模型转换工具变成浏览器友好的模型进行在线预测使用。