From 25b2aa6d0431910ea157f4f6417c4cfcf0337f57 Mon Sep 17 00:00:00 2001 From: Yulong Wang Date: Tue, 8 Jun 2021 10:47:27 -0700 Subject: [PATCH] [doc] update a part of the documents for ORT JavaScript (#7935) * update api-basics.md * update install.md * add placeholder for "build for web" * update js api * add more sections in js-api.md * update "coming soon" for how-to-build-web * Update "Web" -> "web" in title of web.md * Update install.md --- docs/how-to/build/android-ios.md | 2 +- docs/how-to/build/inferencing.md | 2 +- docs/how-to/build/reduced.md | 2 +- docs/how-to/build/web.md | 10 ++++++ docs/how-to/install.md | 4 +-- docs/reference/api/js-api.md | 40 ++++++++++++++++++++++++ docs/reference/api/nodejs-api.md | 37 ---------------------- docs/tutorials/inferencing/api-basics.md | 4 +-- 8 files changed, 57 insertions(+), 44 deletions(-) create mode 100644 docs/how-to/build/web.md create mode 100644 docs/reference/api/js-api.md delete mode 100644 docs/reference/api/nodejs-api.md diff --git a/docs/how-to/build/android-ios.md b/docs/how-to/build/android-ios.md index d476927c9d..1be776ea03 100644 --- a/docs/how-to/build/android-ios.md +++ b/docs/how-to/build/android-ios.md @@ -1,7 +1,7 @@ --- title: Build for Android/iOS parent: Build ORT -nav_order: 4 +nav_order: 5 grand_parent: How to --- diff --git a/docs/how-to/build/inferencing.md b/docs/how-to/build/inferencing.md index f6e1206594..599427fc2a 100644 --- a/docs/how-to/build/inferencing.md +++ b/docs/how-to/build/inferencing.md @@ -101,7 +101,7 @@ GCC 4.x and below are not supported. | OS/Compiler | Supports VC | Supports GCC | Supports Clang | |-------------|:------------:|:----------------:|:----------------:| |Windows 10 | YES | Not tested | Not tested | -|Linux | NO | YES(gcc>=8) | Not tested | +|Linux | NO | YES(gcc>=8) | Not tested | |macOS | NO | Not tested | YES (Minimum version required not ascertained)| --- diff --git a/docs/how-to/build/reduced.md b/docs/how-to/build/reduced.md index 2dc912ef2c..a89aa012da 100644 --- a/docs/how-to/build/reduced.md +++ b/docs/how-to/build/reduced.md @@ -2,7 +2,7 @@ title: Build with reduced size grand_parent: How to parent: Build ORT -nav_order: 5 +nav_order: 6 --- # Build ORT with reduced size diff --git a/docs/how-to/build/web.md b/docs/how-to/build/web.md new file mode 100644 index 0000000000..c5e3f73d46 --- /dev/null +++ b/docs/how-to/build/web.md @@ -0,0 +1,10 @@ +--- +title: Build for web +parent: Build ORT +nav_order: 4 +grand_parent: How to +--- + +# Build ONNX Runtime for Web + + *[COMING SOON]* diff --git a/docs/how-to/install.md b/docs/how-to/install.md index 34fffb5185..46864244e8 100644 --- a/docs/how-to/install.md +++ b/docs/how-to/install.md @@ -39,7 +39,7 @@ The following build variants are available as officially supported packages. Oth |Android|[**com.microsoft.onnxruntime:onnxruntime-mobile**](https://search.maven.org/artifact/com.microsoft.onnxruntime/onnxruntime-mobile) || |iOS (C/C++)|CocoaPods: **onnxruntime-mobile-c**|| |Objective-C|CocoaPods: **onnxruntime-mobile-objc**|| -|Node.js|[**onnxruntime-node**](https://www.npmjs.com/package/onnxruntime)| +|Node.js|[**onnxruntime-node**](https://www.npmjs.com/package/onnxruntime-node)|| |Web|[**onnxruntime-web**](https://www.npmjs.com/package/onnxruntime-web)|| @@ -63,4 +63,4 @@ by running `locale-gen en_US.UTF-8` and `update-locale LANG=en_US.UTF-8` |---|---|---| |PyTorch (CUDA 10.2)|[**onnxruntime-training**](https://pypi.org/project/onnxruntime-training)|[onnxruntime_nightly_cu102](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_cu102.html)| |PyTorch (CUDA 11.1)|[**onnxruntime_stable_cu111**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_cu111.html)|[onnxruntime_nightly_cu111](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_cu111.html)| -|[*Preview*] PyTorch (ROCm 4.2)|[**onnxruntime_stable_rocm42**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_rocm42.html)|[onnxruntime_nightly_rocm42](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_rocm42.html)| \ No newline at end of file +|[*Preview*] PyTorch (ROCm 4.2)|[**onnxruntime_stable_rocm42**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_rocm42.html)|[onnxruntime_nightly_rocm42](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_rocm42.html)| diff --git a/docs/reference/api/js-api.md b/docs/reference/api/js-api.md new file mode 100644 index 0000000000..5042dbddb1 --- /dev/null +++ b/docs/reference/api/js-api.md @@ -0,0 +1,40 @@ +--- +title: JavaScript API +parent: API docs +grand_parent: Reference +--- + +# ONNX Runtime JavaScript API +{: .no_toc } + +ONNX Runtime JavaScript API is the unified interface used by [ONNX Runtime Node.js binding](https://github.com/microsoft/onnxruntime/tree/master/js/node), [ONNX Runtime Web](https://github.com/microsoft/onnxruntime/tree/master/js/web) and [ONNX Runtime for React Native](https://github.com/microsoft/onnxruntime/tree/master/js/react_native). + +## Contents +{: .no_toc } + +* TOC placeholder +{:toc} + + +## Supported Versions + +- ONNX Runtime Node.js binding: Node.js v12.x+ or Electron v5.x+ +- ONNX Runtime Web: mainstream modern browsers on Windows, macOS, Android and iOS. +- ONNX Runtime for React Native: TBD + +## Builds + +Builds 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 (Release)| Windows x64 CPU NAPI_v3, Linux x64 CPU NAPI_v3, MacOS x64 CPU NAPI_v3| +|Web|[onnxruntime-web](https://www.npmjs.com/package/onnxruntime-web)||Browsers (wasm, webgl), Node.js (wasm)| +|React Native|[onnxruntime-react-native](https://www.npmjs.com/package/onnxruntime-react-native)||| + +For Node.js binding, to use on platforms without pre-built binaries, you can [build Node.js binding from source](../../how-to/build/inferencing.md#apis-and-language-bindings) and consume using `npm install /js/node/`. + +## API Reference +See Typescript declarations for [Inference Session](https://github.com/microsoft/onnxruntime/blob/master/js/common/lib/inference-session.ts), [Tensor](https://github.com/microsoft/onnxruntime/blob/master/js/common/lib/tensor.ts) and [Environment Flags](https://github.com/microsoft/onnxruntime/blob/master/js/common/lib/env.ts) for reference. + +See also [ONNX Runtime JavaScript examples](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js). diff --git a/docs/reference/api/nodejs-api.md b/docs/reference/api/nodejs-api.md deleted file mode 100644 index 82b0e1b8bd..0000000000 --- a/docs/reference/api/nodejs-api.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Node.js API -parent: API docs -grand_parent: Reference ---- - -# ONNX Runtime Node.js API -{: .no_toc } - -ONNX Runtime Node.js binding enables Node.js applications to run ONNX model inference. - -## Contents -{: .no_toc } - -* TOC placeholder -{:toc} - -## Supported Versions -Node.js v12.x+ or Electron v5.x+ - -## API Reference -See [Typescript declarations](https://github.com/microsoft/onnxruntime/blob/master/nodejs/lib/inference-session.ts) and refer to [samples](#samples) for reference. - -## Builds -Builds are published to **npm** and can be installed using `npm install` - -| Artifact | Description | Supported Platforms | -|----------- |-------------|---------------------| -|[onnxruntime](https://www.npmjs.com/package/onnxruntime)|CPU (Release)| Windows x64 CPU NAPI_v3, Linux x64 CPU NAPI_v3, MacOS x64 CPU NAPI_v3| -|onnxruntime@dev| CPU (Dev)|Windows x64 CPU NAPI_v3, Linux x64 CPU NAPI_v3, MacOS x64 CPU NAPI_v3| - -To use on platforms without pre-built binaries, you can [build Node.js binding from source]((../../how-to/build.md#apis-and-language-bindings)) and consume using `npm install /nodejs/`. - -## Samples -See [Tutorials: Basics - NodeJS](../../tutorials/inferencing/api-basics.md#nodejs) - - diff --git a/docs/tutorials/inferencing/api-basics.md b/docs/tutorials/inferencing/api-basics.md index e831b342f4..73f8cecb11 100644 --- a/docs/tutorials/inferencing/api-basics.md +++ b/docs/tutorials/inferencing/api-basics.md @@ -36,5 +36,5 @@ These tutorials demonstrate basic inferencing with ONNX Runtime with each langua ## Java * [Number recognition (MNIST)](../tutorials/mnist_java.html) -## Node.js -* [Basic usage](https://github.com/microsoft/onnxruntime/tree/master/samples/nodejs) +## JavaScript +* [ONNX Runtime JavaScript examples](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js)