Skip to content
This repository was archived by the owner on Jun 4, 2021. It is now read-only.

Commit d31117e

Browse files
committed
add readme and license
1 parent 1dc2243 commit d31117e

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

LICENSE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
onnxjs-node
2+
3+
Copyright (c) fs-eire. All rights reserved.
4+
5+
MIT License
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# onnxjs-node
2+
**onnxjs-node** is a Node.js binding of [ONNXRuntime](https://github.com/Microsoft/onnxruntime) that works seamlessly with [ONNX.js](https://github.com/Microsoft/onnxjs).
3+
4+
## Installation
5+
Install the latest stable version:
6+
```
7+
npm install onnxjs-node
8+
```
9+
10+
*NOTE: binary files will be pulled from github during the `npm install` process.*
11+
12+
## Supported Platforms
13+
- Windows x64 CPU NAPI_v3
14+
- Linux x64 CPU NAPI_v3
15+
- Windows x64 GPU NAPI_v3
16+
- Linux x64 GPU NAPI_v3
17+
18+
## Usage
19+
There are 2 options to import `onnxjs-node`.
20+
- Option 1 - replace `onnxjs` by `onnxjs-node`:
21+
```js
22+
//const onnx = require('onnxjs');
23+
const onnx = require('onnxjs-node');
24+
25+
// use 'onnx'
26+
// ...
27+
```
28+
- Option 2 - add a single line to require `onnxjs-node`:
29+
```js
30+
const onnx = require('onnxjs');
31+
require('onnxjs-node'); // this line can be put on the top as well
32+
33+
// use 'onnx'
34+
// ...
35+
```
36+
37+
After `onnxjs-node` is imported, the default inference session class of ONNX.js will be overwritten. Any existing ONNX.js code will continue to work and model will run by ONNXRuntime backend.
38+
39+
## Options
40+
### Enable/Disable GPU
41+
Coming soon...
42+
### Backend Fallback
43+
After `onnxjs-node` is imported, ONNXRuntime backend will be used by default. However, it is possible to fallback to other backend by specifying the session option `backendHint`:
44+
```js
45+
session = new onnx.InferenceSession({backendHint: 'wasm'}); // use WebAssembly backend
46+
```
47+
48+
## Documentation
49+
- [ONNX.js Home](https://github.com/Microsoft/onnxjs)
50+
- [ONNXRuntime](https://github.com/Microsoft/onnxruntime)
51+
52+
# License
53+
Copyright (c) fs-eire. All rights reserved.
54+
55+
Licensed under the [MIT](https://github.com/fs-eire/onnxjs-node/blob/master/LICENSE) License.

0 commit comments

Comments
 (0)