-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
108 lines (89 loc) · 4.28 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<html lang="en">
<head>
<title>Hand Turkey</title>
<meta name="viewport" content="width=device-width, initial-scale=0.7, shrink-to-fit=no, user-scalable=no">
<link rel="stylesheet" href="style.css">
<!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
crossorigin="anonymous"></script>
<!-- stylesheet for literally-canvas-->
<link href="assets/literallycanvas.css" rel="stylesheet">
<!-- Require the peer dependencies of handpose. -->
<script src="https://unpkg.com/@tensorflow/tfjs-core@2.1.0/dist/tf-core.js"></script>
<script src="https://unpkg.com/@tensorflow/tfjs-converter@2.1.0/dist/tf-converter.js"></script>
<!-- You must explicitly require a TF.js backend if you're not using the tfs union bundle. -->
<!-- <script src="https://unpkg.com/@tensorflow/tfjs-backend-cpu@2.1.0/dist/tf-backend-cpu.js"></script>-->
<script src="https://unpkg.com/@tensorflow/tfjs-backend-webgl@2.1.0/dist/tf-backend-webgl.js"></script>
<script src="https://unpkg.com/@tensorflow-models/handpose@0.0.6/dist/handpose.js"></script>
</head>
<body>
<div class="container-fluid p-5">
<div class="fs-container">
<div id="lc"></div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="turkeyModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Capture your turkey once it looks about right!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="d-flex justify-content-center" id="spinner">
<div class="spinner-border text-primary" style="width: 5rem; height: 5rem;" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<div id="canvas-wrapper" class="d-flex justify-content-center">
<canvas id="output" style=""></canvas>
<video id="video" playsinline></video>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" id="btn-capture" class="btn btn-primary" data-dismiss="modal">Capture Turkey
</button>
</div>
</div>
</div>
</div>
<script src="handpose/main.js"></script>
<script src="handpose/offset.min.js"></script>
<script src="js_libs/react-0.14.3.js"></script>
<script src="js_libs/literallycanvas.js"></script>
<script>
$("#turkeyModal").modal({backdrop: 'static', keyboard: false});
</script>
<script type="text/javascript">
let el = document.getElementById("lc");
let Turkey = function (lc) { // take lc as constructor arg
return {
name: 'Capture Turkey',
iconName: 'turkey',
optionsStyle: 'null'
}
};
let lc = LC.init(el, {
imageURLPrefix: './assets/lc-images',
toolbarPosition: 'bottom',
defaultStrokeWidth: 8,
strokeWidths: [2, 4, 8, 16, 32],
tools: LC.defaultTools.concat([Turkey])
});
</script>
</body>
</html>