-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
61 lines (52 loc) · 1.41 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Background Removal</title>
<!-- Load TensorFlow.js -->
<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>Background Removal w/ BodyPix</h1>
<div class="container parent">
<div class="video box">
<video id="video" autoplay width="640px" height="480px">
</video>
</div>
<div class="removed box">
<canvas id="canvas" autoplay width="640px" height="480px">
</canvas>
</div>
</div>
<style>
h1 {
text-align: center;
padding: 2rem;
}
#video,
#canvas {
border: 2px solid black;
text-align: center;
}
#canvas {
background-image: url('bg.jpg');
}
.parent {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.box {
flex: 1 1 150px;
/* Stretching: */
flex: 0 1 150px;
/* No stretching: */
margin: 5px;
}
</style>
<script defer src="main.js"></script>
</body>
</html>