Created
January 30, 2023 17:28
-
-
Save abgoswam/9896de2e365b1716c9c0eb210c4b42a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as ort from 'onnxruntime-node'; | |
// use an async context to call onnxruntime functions. | |
async function main() { | |
ort.InferenceSession | |
const session = await ort.InferenceSession.create('./model4.onnx'); | |
// prepare feeds. use model input names as keys. | |
const feeds = { | |
float32_input: new ort.Tensor('float32', new Array<number>(221).fill(1), [1, 221]), | |
}; | |
const model_outputs = await session.run(feeds); | |
let probabilityAccept = Number(model_outputs['probabilities']['data'][1]); | |
console.log(probabilityAccept); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Standalone TS file works fine. We get the correct scores as output of the model