scrawl-canvas
Version:
Version 8.9.4 - 19 Nov 2022
76 lines (63 loc) • 2.31 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 002</title>
<link href="css/normalize.css" rel="stylesheet" />
<link href="css/tests.css" rel="stylesheet" />
<style>
.controls {
grid-template-columns: 1fr 2fr 1fr 2fr;
}
</style>
</head>
<body>
<h1><a href="index.html">Scrawl-canvas v8</a> - Tensorflow test 002</h1>
<h2>Tensorflow tfjs-models / body-pix experiment - model image output</h2>
<h3>This demo should work in Chrome and Firefox browsers; fails in Safari</h3>
<div class="controls">
<div class="yellow label">Background filter</div>
<div class="yellow">
<select class="controlItem" id="backgroundFilter">
<option value="">None</option>
<option value="grayscale">Grayscale</option>
<option value="sepia">Sepia</option>
<option value="invert">Invert</option>
<option value="red">Red</option>
<option value="background-blur">Blur</option>
<option value="pixelate">Pixelate</option>
</select>
</div>
<div class="yellow label">Blur outline</div>
<div class="yellow">
<select class="controlItem" id="outlineFilter">
<option value="0">False</option>
<option value="1">True</option>
</select>
</div>
</div>
<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>Apply filters to both the identified bodies, and to the background</li>
</ul>
<p><b>Touch test:</b> not required</p>
<p><a href="../docs/demo/tensorflow-002.html">Annotated code</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.2"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/body-pix@2.0"></script>
<script src="tensorflow-002.js" type="module"></script>
</body>
</html>