-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·268 lines (243 loc) · 10.8 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<!DOCTYPE html>
<html lang="en">
<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>MasterClass</title>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="lib/famous.css" />
<link rel="stylesheet" type="text/css" href="css/app.css" />
<link rel="shortcut icon" href="#">
<script type="text/javascript" src="lib/jquery.min.js"></script>
<!-- Famo.us -->
<script type="text/javascript" src="lib/famous.min.js"></script>
<!-- Underscore/Backbone -->
<script type="text/javascript" src="lib/underscore.min.js"></script>
<script type="text/javascript" src="lib/backbone.min.js"></script>
<!-- CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<!-- slower version -->
<!-- <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>
<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> -->
<!-- TF.js backend -->
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/camera_utils/camera_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/control_utils/control_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/drawing_utils/drawing_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands/hands.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://unpkg.com/fingerpose@0.0.2/dist/fingerpose.js"></script>
</head>
<body>
<h2 class="text-center mt-5">MasterClass</h2>
<div class="input-group mx-auto mt-3 mb-4" style="width: 50%">
<input type="search" class="form-control form-control rounded" placeholder="Paste Youtube Link" aria-label="Search" aria-describedby="search-addon" />
<button type="submit" class="btn btn-outline-primary btn" onClick="javascript:openUrl(this)">search</button>
</div>
<div id="videoRow">
<div id="invisibleVideoContainer">
</div>
<div id="youtubeVideo">
<div class="text-center"> <div id="player"></div></div>
<div class="text-center" id="speechDebug">Speech: </div>
</div>
<div id="videoContainer">
<div class="text-center">
<button class="btn btn-outline-primary" onclick="$('#videoSubContainer').toggle();">
View/Hide Webcam
</button>
</div>
<div id="videoSubContainer">
<video autoplay="true" class="videoElement" style="display:none"></video>
<canvas class="canvas" width="256" height="192"></canvas>
</div>
<div class="text-center" id="gestureDebug">Gesture: No hands in frame</div>
</div>
</div>
<h3 class="text-center mt-5">Instructions</h3>
<div class="mx-auto mb-5" id="accordion" style="width: 50%">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="accordion-button collapsed" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
Voice Commands
</button>
</h5>
</div>
<div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
Use the following commands to control the video.
<span></span>
<table class="table">
<thead>
<tr>
<th scope="col">Simple Voice Commands</th>
<th scope="col">Video Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>masterclass play</td>
<td>Play video</td>
</tr>
<tr>
<td>masterclass pause <i>or</i> masterclass stop</td>
<td>Pause video</td>
</tr>
<tr>
<td>masterclass restart</td>
<td>Restart video</td>
</tr>
<tr>
<td>masterclass skip <i>or</i> masterclass forward</td>
<td>Skip ahead by 10 seconds</td>
</tr>
<tr>
<td>masterclass rewind <i>or</i> masterclass backwards</td>
<td>Rewind by 10 seconds</td>
</tr>
<tr>
† <td>masterclass volume up <i>or</i> masterclass louder</td>
<td>Increase the volume by 10%</td>
</tr>
<tr>
<td>masterclass volume down <i>or</i> masterclass quieter</td>
<td>Decrease the volume by 10%</td>
</tr>
<tr>
<td>masterclass increase speed <i>or</i> masterclass speed up</td>
<td>Increase the speed by 0.25</td>
</tr>
<tr>
<td>masterclass decrease speed <i>or</i> masterclass slow down </td>
<td>Decrease the speed by 0.25</td>
</tr>
</tbody>
</table>
<table class="table">
<thead>
<tr>
<th scope="col">Complex Voice Command</th>
<th scope="col">Video Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>masterclass jump/go to <i>mm:ss</i> (eg. 10:54)</td>
<td>Go to timestamp <i>mm:ss</i></td>
</tr>
<tr>
<td>masterclass skip/forward <i>x</i> seconds/minutes</td>
<td>Skip ahead by <i>x</i> seconds/minutes</td>
</tr>
<tr>
<td>masterclass rewind/backwards by <i>x</i> seconds/minutes</td>
<td>Rewind by <i>x</i> seconds/minutes</td>
</tr>
<tr>
<td>masterclass change/set volume to <i>x</i></td>
<td>Change volume to <i>x</i></td>
</tr>
<tr>
<td>masterclass change/set speed to <i>x</i></td>
<td>Change speed to <i>x</i></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingTwo">
<h5 class="mb-0">
<button class="accordion-button collapsed" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Gesture Commands
</button>
</h5>
</div>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
<div>
<div class="row">
<img class="fit-picture col-md-3" src="/img/open_palm.png">
<img class="fit-picture col-md-3" src="/img/fist.png">
<img class="fit-picture col-md-3" src="/img/point_right.png">
<img class="fit-picture col-md-3" src="/img/point_left.png">
</div>
<div>
<br>
<p>From left to right the gestures represent: start, stop, and skip forward, rewind.</p>
</div>
<div class="row">
<img class="fit-picture col-md-3" src="/img/double_open_palm.png">
<img class="fit-picture col-md-3" src="/img/double_fist.png">
<img class="fit-picture col-md-3" src="/img/thumbs_up.png">
<img class="fit-picture col-md-3" src="/img/thumbs_down.png">
</div>
<div>
<br>
<p>From left to right the gestures represent: volume up, volume down, speed up, and slow down.</p>
</div>
</div>
<table class="table">
<thead>
<tr>
<th scope="col">Gesture Command</th>
<th scope="col">Video Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>Open palm</td>
<td>Play video</td>
</tr>
<tr>
<td>Fist</td>
<td>Pause video</td>
</tr>
<tr>
<td>Point right</td>
<td>Skip ahead by 10 seconds</td>
</tr>
<tr>
<td>Point left</td>
<td>Rewind by 10 seconds</td>
</tr>
<tr>
<td>Two open palms</td>
<td>Increase the volume by 10%</td>
</tr>
<tr>
<td>Two fists</td>
<td>Decrease the volume by 10%</td>
</tr>
<tr>
<td>Thumbs up </td>
<td>Increase the speed by 0.25x</td>
</tr>
<tr>
<td>Thumbs down</td>
<td>Decrease the speed by 0.25x</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- App code -->
<!-- <script type="text/javascript" src="app/gestures.js"></script> -->
<script>import * as fp from "fingerpose";</script>
<!-- <script>import { FistGesture, OpenPalmGesture } from './gestures.js';</script> -->
<script type="text/javascript" src="app/speech.js"></script>
<script type="text/javascript" src="app/video.js"></script>
<script type="text/javascript" src="app/youtube.js"></script>
<script type="text/javascript" src="app/setupSpeech.js"></script>
<script type="text/javascript" src="app/gestures.js"></script>
</body>
</html>