-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
77 lines (69 loc) · 3.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<title>greenscreen-machine</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="src/index.css">
<link rel="stylesheet" type="text/css" href="src/bar-graph.css">
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/image@0.8.3/dist/teachablemachine-image.min.js"></script>
<script src="https://unpkg.com/@tensorflow-models/body-pix@2.0.2/dist/body-pix.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jszip@3.2.2/dist/jszip.min.js"></script>
<div>
<div style="margin: 10px; border-radius: 10px; box-shadow: 0px 2px 2px rgba(0,0,0,0.20); background: green; backround-repeat: no-repeat; padding: 20px;">
<h1><a href="/">greenscreen-machine</a></h1>
</div>
<div class="VerticalSection" style="display: flex; flex-direction: row;">
<div class="Panel">
<div class="Panel-content">
<h2>1. Turn on webcam greenscreen</h2>
<div class="IntructionsText" style="margin-top: 10px;">
<div>This will turn on your webcam, use <a href="https://github.com/tensorflow/tfjs-models/tree/master/body-pix">BodyPix</a> to edit out the background, and composite any people into images from <a href="https://picsum.photos/">picsum.photos</a>.</div>
<div style="margin-top: 10px;">Click on an image for a new background.</div>
</div>
</div>
<div class="Panel-actions">
<div class="Status" id="webcam-status"></div>
<button class="File Button" id="webcam-start">Start</button >
</div>
</div>
<div class="Panel">
<div class="Panel-content">
<h2>2. Try your image model</h2>
<div class="Panel-text">Next, load an image model you created with your webcam in <a target="_blank" href="https://teachablemachine.withgoogle.com/train/image">Teachable Machine</a>, and see how it does. This only accepts zip files uploaded locally.</div>
</div>
<div class="Panel-actions">
<div class="Status" id="model-status"></div>
<div class="File Button">
<div class="File-caption">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 6H20C21.1 6 22 6.9 22 8V18C22 19.1 21.1 20 20 20H4C2.9 20 2 19.1 2 18L2.01 6C2.01 4.9 2.9 4 4 4H10L12 6ZM4 8V18H20V8H4Z" fill="#888"></path>
</svg>
Open model.zip
</div>
<input id="model-zip-input" class="fileList" type="file" accept="application/zip">
</div>
<a class="ExampleLink" href="/data/d-waving-model.zip"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 12.17L15.59 9.59L17 11L12 16L7 11L8.41 9.59L11 12.17V4H13V12.17ZM6 15H4V18C4 19.1 4.9 20 6 20H18C19.1 20 20 19.1 20 18V15H18V18H6V15Z" fill="#888"></path>
</svg>
<span>Download example</span>
</a>
</div>
</div>
</div>
<div>
<div class="Workspace" id="workspace"></div>
</div>
<div id="log"></div>
</div>
<script type="module">
import {main} from './src/index.js';
main();
</script>
</body>
</html>