scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
57 lines (45 loc) • 1.92 kB
HTML
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo Tensorflow 001</title>
<link href="css/normalize.css" rel="stylesheet" />
<link href="css/tests.css" rel="stylesheet" />
<!-- Examples all show the files being loaded in the head, not at the end of the body -->
<!-- Load TensorFlow.js - example uses v1.2, not v2 -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.2"></script>
<!-- Load BodyPix -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/body-pix@2.0"></script>
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - Tensorflow test 001</h1>
<h2>Tensorflow tfjs-models / body-pix experiment - follow my eyes</h2>
<h3>This demo should work in Chrome and Firefox browsers; fails in Safari</h3>
<canvas
id="mycanvas"
width="600"
height="400"
data-scrawl-canvas
></canvas>
<p id="reportmessage"></p>
<div class="testinfo">
<h4>Test purpose</h4>
<ul>
<li>Check that the media stream loads (if browser/device supports it)</li>
<li>Check that we can load and use both Tensorflow (from a CDN) and its body-pix model</li>
<li>Apply the model to a live camera feed</li>
<li>Create a RawAsset object to handle the model's output. In particular</li>
<ul>
<li>Parse the output's metadata to identify the left and right eyes</li>
<li>Calculate the position of each eye, averaged over several iterations</li>
<li>Update the RawAsset's canvas with two transluscent circles covering over the eyes</li>
</ul>
</ul>
<p><b>Touch test:</b> not required</p>
<p><a href="../docs/demo/tensorflow-001.html">Annotated code</a></p>
</div>
<script src="tensorflow-001.js" type="module"></script>
</body>
</html>