@natsuite/resnet18
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

ResNet 18

Image classifier for our super-important top-secret new product.

Making Predictions

First, create the predictor:

// Fetch the model data from NatML Hub
const modelData = await MLModelData.fromHub("@natsuite/resnet18");
// Deserialize the model
const model = modelData.deserialize();
// Create the predictor
const predictor = new ResNet18HubPredictor(model);

Then create an image feature:

// Create an iamge feature
const feature = new MLImageFeature("cat.jpg");

Finally, classify the image feature:

// Classify the image
const [label, score] = await predictor.predict(feature);
// Log result
console.log(`Image contains ${label} with confidence ${score}`);

Package Sidebar

Install

npm i @natsuite/resnet18

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

8.49 kB

Total Files

7

Last publish

Collaborators

  • olokobayusuf