How to use the @tensorflow/tfjs-automl.loadImageClassification function in @tensorflow/tfjs-automl

To help you get started, we’ve selected a few @tensorflow/tfjs-automl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tensorflow / tfjs / tfjs-automl / demo / img_classification / index.js View on Github external
async function run() {
  const model = await automl.loadImageClassification(MODEL_URL);
  const image = document.getElementById('daisy');
  const predictions = await model.classify(image);

  // Show the resulting object on the page.
  const pre = document.createElement('pre');
  pre.textContent = JSON.stringify(predictions, null, 2);
  document.body.append(pre);
}

@tensorflow/tfjs-automl

This packages provides a set of APIs to load and run models produced by AutoML Edge.

Apache-2.0
Latest version published 3 years ago

Package Health Score

43 / 100
Full package analysis