How to use @tensorflow/tfjs-automl - 2 common examples

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);
}
github tensorflow / tfjs / tfjs-automl / demo / object_detection / index.js View on Github external
async function run() {
  const model = await automl.loadObjectDetection(MODEL_URL);
  const image = document.getElementById('salad');
  // These are the default options.
  const options = {score: 0.5, iou: 0.5, topk: 20};
  const predictions = await model.detect(image, options);

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

  drawBoxes(predictions);
}

@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

46 / 100
Full package analysis

Similar packages