Last active
November 2, 2018 23:06
-
-
Save steerapi/3d1c9aaaa1ae8a441a84f6a306a2c495 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
const model = new ModelDescriptor({ | |
modelId: 'QmZ9db8JzNCNrKuYyFN4Sv3a4Rn9CgZM99owJXwFjUhCik', | |
modelPath: 'https://cloudflare-ipfs.com/ipfs/QmZ9db8JzNCNrKuYyFN4Sv3a4Rn9CgZM99owJXwFjUhCik', // resnet18 pytorch model | |
modelType: 'torchjs/cuda' | |
}); | |
await node.initModel(model) | |
node.inferModel(model, inputs).on('response', (outputs, confidences, finish) => { | |
// Do something with the outputs, confidences | |
// call finish() to finish the computation if outputs are already highly confidence | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment