isomorphic-onnxruntime
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

✨ Isomorphic ONNX Runtime for Web and Node

This library is a thin wrapper around the ONNX Runtime that allows you to ship almost same code for each platform. All it does is imports right version of the ONNX Runtime and exposes it to you as if it was a single library.

Installation

[!CAUTION] Tested only with 1.16.x version of the ONNX Runtime. Other versions may not work, but library is straightforward and should work with most future versions.

yarn install isomorphic-onnxruntime onnxruntime-common onnxruntime-web onnxruntime-node

Usage

Usage is straightforward. You just import the library and use it as you would use the ONNX Runtime.

import { InferenceSession } from "isomorphic-onnxruntime"; // instead of "onnxruntime-web" or "onnxruntime-node"

// All code is the same as with original libraries

Check installation

When in doubt you can always check loaded environment by importing environment from isomorphic-onnxruntime and checking it's value:

import { environment } from "isomorphic-onnxruntime";
console.log(environment); // "web" or "node"

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i isomorphic-onnxruntime

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.29 kB

Total Files

14

Last publish

Collaborators

  • steve.kite