ONNX Runtime
- microsoft/onnxruntime
- MIT, C++
- C++, C, Python, C#, Java, JS, Node, React Native, Objective-C, Swift
- pip:onnxruntime pip:onnxruntime-gpu
- npm:onnxruntime-web npm:onnxruntime-node, npm:onnxruntime-react-native
- 参考
- Inferencing
- Generative AI 实验阶段
import * as ort from 'onnxruntime-web';
// Load the model and create InferenceSession
const modelPath = 'path/to/your/onnx/model';
const session = await ort.InferenceSession.create(modelPath);
// Load and preprocess the input image to inputTensor
// ...
// Run inference
const outputs = await session.run({ input: inputTensor });
console.log(outputs);