How to use @tensorflow-models/blazeface - 1 common examples

To help you get started, we’ve selected a few @tensorflow-models/blazeface 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-models / blazeface / demo / index.js View on Github external
video.play();

  videoWidth = video.videoWidth;
  videoHeight = video.videoHeight;
  video.width = videoWidth;
  video.height = videoHeight;

  canvas = document.getElementById('output');
  canvas.width = videoWidth;
  canvas.height = videoHeight;
  ctx = canvas.getContext('2d');
  ctx.translate(canvas.width, 0);
  ctx.scale(-1, 1);
  ctx.fillStyle = "rgba(255, 0, 0, 0.5)";

  model = await blazeface.load();

  renderPrediction();
};

@tensorflow-models/blazeface

Pretrained face detection model in TensorFlow.js

Apache-2.0
Latest version published 9 months ago

Package Health Score

80 / 100
Full package analysis

Popular @tensorflow-models/blazeface functions

Similar packages