diff --git a/docs/get-started/with-javascript/index.md b/docs/get-started/with-javascript/index.md index c62d8a5c87705..055f4d9bde489 100644 --- a/docs/get-started/with-javascript/index.md +++ b/docs/get-started/with-javascript/index.md @@ -19,31 +19,3 @@ See [how to choose the right package](../../tutorials/web/build-web-app#options- * Get Started with [ONNX Runtime Web](web.md) * Get Started with [ONNX Runtime Node.js binding](node.md) * Get Started with [ONNX Runtime for React Native](react-native.md) -* [Builds](#builds) -* [API Reference](#api-reference) - -## Builds - -[Builds](https://onnxruntime.ai/docs/build/web.html) are published to **npm** and can be installed using `npm install` - -| Package | Artifact | Description | Supported Platforms | -|---------|-----------|-------------|---------------------| -|Node.js binding|[onnxruntime-node](https://www.npmjs.com/package/onnxruntime-node)|CPU and GPU (Release/NAPI_v3)| Windows x64: cpu, dml
Windows arm64: cpu, dml
Linux x64: cpu, cuda
Linux arm64: cpu
MacOS x64: cpu
MacOS arm64: cpu| -|Web|[onnxruntime-web](https://www.npmjs.com/package/onnxruntime-web)|CPU and GPU|Chromium Browsers (Chrome, Edge): wasm, webgl, webgpu, webnn
Safari: wasm, webgl
Other Browsers: wasm
Node.js: wasm| -|React Native|[onnxruntime-react-native](https://www.npmjs.com/package/onnxruntime-react-native)|CPU|Android, iOS| - -- For Web, pre-built binaries are published in NPM package as well as served in CDNs. If you want to use a custom build, you can [build ONNX Runtime Web from source](../../build/web.md). -- For Node.js binding, to use on platforms without pre-built binaries, you can [build Node.js binding from source](../../build/inferencing.md#apis-and-language-bindings) and consume using `npm install /js/node/`. -- Explore a simple web application to [classify images with ONNX Runtime Web](https://onnxruntime.ai/docs/tutorials/web/classify-images-nextjs-github-template.html). - -## API Reference - -See [ONNX Runtime JavaScript API](../../api/js/index.html){:target="_blank"} for API reference. - -See also: - -- [ONNX Runtime JavaScript examples and API Usage](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js). - -- [ONNX Runtime Web demos](https://microsoft.github.io/onnxruntime-web-demo/#/) for image recognition, handwriting analysis, real-time emotion detection, object detection, and so on. - -- Typescript declarations for [Inference Session](https://github.com/microsoft/onnxruntime/blob/main/js/common/lib/inference-session.ts), [Tensor](https://github.com/microsoft/onnxruntime/blob/main/js/common/lib/tensor.ts), and [Environment Flags](https://github.com/microsoft/onnxruntime/blob/main/js/common/lib/env.ts) for reference. diff --git a/docs/get-started/with-javascript/node.md b/docs/get-started/with-javascript/node.md index af1e934d0fde8..ca61caa89bd6c 100644 --- a/docs/get-started/with-javascript/node.md +++ b/docs/get-started/with-javascript/node.md @@ -38,5 +38,17 @@ const ort = require('onnxruntime-node'); ## Supported Versions -ONNX Runtime Node.js binding supports Node.js v12.x+ or Electron v5.x+ +The following table lists the supported versions of ONNX Runtime Node.js binding provided with pre-built binaries. + +| EPs/Platforms | Windows x64 | Windows arm64 | Linux x64 | Linux arm64 | MacOS x64 | MacOS arm64 | +|--------------|--------|---------|--------|------|---|----| +| CPU | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| DirectML | ✔️ | ✔️ | ❌ | ❌ | ❌ | ❌ | +| CUDA | ❌ | ❌ | ✔️[1] | ❌ | ❌ | ❌ | + + +- [1]: CUDA v11.8. + + +For platforms not on the list or want a custom build, you can [build Node.js binding from source](../../build/inferencing.md#apis-and-language-bindings) and consume using `npm install /js/node/`. diff --git a/docs/get-started/with-javascript/web.md b/docs/get-started/with-javascript/web.md index fd7c8e5638f27..6a8d38da35354 100644 --- a/docs/get-started/with-javascript/web.md +++ b/docs/get-started/with-javascript/web.md @@ -54,13 +54,17 @@ For a complete table for importing, see [Conditional Importing](https://github.c ## Documentation -See [Tutorial: Web](../../tutorials/web/index.md) for more details. Please also check the following links: +See [ONNX Runtime JavaScript API](../../api/js/index.html){:target="_blank"} for API reference. Please also check the following links for API usage examples: - [Tensor](https://github.com/microsoft/onnxruntime-inference-examples/blob/main/js/api-usage_tensor) - a demonstration of basic usage of Tensor. - [Tensor <--> Image conversion](https://github.com/microsoft/onnxruntime-inference-examples/blob/main/js/api-usage-tensor-image) - a demonstration of conversions from Image elements to and from Tensor. - [InferenceSession](https://github.com/microsoft/onnxruntime-inference-examples/blob/main/js/api-usage_inference-session) - a demonstration of basic usage of InferenceSession. - [SessionOptions](https://github.com/microsoft/onnxruntime-inference-examples/blob/main/js/api-usage_session-options) - a demonstration of how to configure creation of an InferenceSession instance. - [ort.env flags](https://github.com/microsoft/onnxruntime-inference-examples/blob/main/js/api-usage_ort-env-flags) - a demonstration of how to configure a set of global flags. +- See also: Typescript declarations for [Inference Session](https://github.com/microsoft/onnxruntime/blob/main/js/common/lib/inference-session.ts), [Tensor](https://github.com/microsoft/onnxruntime/blob/main/js/common/lib/tensor.ts), and [Environment Flags](https://github.com/microsoft/onnxruntime/blob/main/js/common/lib/env.ts) for reference. + +See [Tutorial: Web](../../tutorials/web/index.md) for tutorials. + See [Training on web demo](https://github.com/microsoft/onnxruntime-training-examples/tree/master/on_device_training/web) for training using onnxruntime-web. ## Examples @@ -70,9 +74,12 @@ The following examples describe how to use ONNX Runtime Web in your web applicat - [Quick Start (using script tag)](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js/quick-start_onnxruntime-web-script-tag) The following are E2E examples that uses ONNX Runtime Web in web applications: +- [Classify images with ONNX Runtime Web](https://onnxruntime.ai/docs/tutorials/web/classify-images-nextjs-github-template.html) - a simple web application using Next.js for image classifying. +- [ONNX Runtime Web demos](https://microsoft.github.io/onnxruntime-web-demo/#/) for image recognition, handwriting analysis, real-time emotion detection, object detection, and so on. - [OpenAI Whisper](https://github.com/microsoft/onnxruntime-inference-examples/blob/main/js/ort-whisper) - demonstrates how to run [whisper tiny.en](https://github.com/openai/whisper) in your browser using onnxruntime-web and the browser's audio interfaces. - [Facebook Segment-Anything](https://github.com/microsoft/onnxruntime-inference-examples/blob/main/js/segment-anything) - demonstrates how to run [segment-anything](https://github.com/facebookresearch/segment-anything) in your browser using onnxruntime-web with webgpu. + The following are video tutorials that use ONNX Runtime Web in web applications: - [ONNX Runtime Web for In Browser Inference](https://youtu.be/0dskvE4IvGM) - [Inference in Javascript with ONNX Runtime Web](https://youtu.be/vYzWrT3A7wQ) @@ -80,5 +87,15 @@ The following are video tutorials that use ONNX Runtime Web in web applications: ## Supported Versions - -ONNX Runtime supports mainstream modern browsers/OS on Windows, Ubuntu, macOS, Android, and iOS. Specifically, for Chromium-based browsers, ONNX Runtime Web supports wasm, webgl, webgpu, and webnn EPs. For Safari, ONNX Runtime Web supports wasm and webgl EPs. For other browsers or Node.js, ONNX Runtime Web supports wasm EP. +| EPs/Browsers | Chrome/Edge (Windows) | Chrome/Edge (Android) | Chrome/Edge (MacOS) | Chrome/Edge (iOS) | Safari (MacOS) | Safari (iOS) | Firefox (Windows) | Node.js | +|--------------|--------|---------|--------|------|---|----|------|-----| +| WebAssembly (CPU) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️\[1] | +| WebGPU | ✔️\[2] | ✔️\[3] | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ | +| WebGL | ✔️\[4] | ✔️\[4] | ✔️\[4] | ✔️\[4] | ✔️\[4] | ✔️\[4] | ✔️\[4] | ❌ | +| WebNN | ✔️\[5] | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | + +- \[1]: Node.js only support single-threaded `wasm` EP. +- \[2]: WebGPU requires Chromium v113 or later on Windows. Float16 support requires Chrome v121 or later, and Edge v122 or later. +- \[3]: WebGPU requires Chromium v121 or later on Windows. +- \[4]: WebGL support is in maintenance mode. It is recommended to use WebGPU for better performance. +- \[5]: Requires to launch browser with commandline flag `--enable-experimental-web-platform-features`. \ No newline at end of file