-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
216 lines (198 loc) · 10.2 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="AI voice-controlled trainer in your browser">
<meta name="author" content="Javier Campos">
<title>🎙️ Fitness Voice</title>
<link href="./assets/bootstrap.min.css" rel="stylesheet"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link href="./assets/style.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="./assets/bootstrap.bundle.min.js"
integrity="sha384-LtrjvnR4Twt/qOuYxE721u19sVFLVSA4hf/rRt6PrZTmiPltdZcI7q7PXQBYTKyf"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/[email protected]/dist/teachablemachine-pose.min.js"></script>
<script
src="https://cdn.jsdelivr.net/npm/@tensorflow-models/[email protected]/dist/speech-commands.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.min.js"
integrity="sha256-R4pqcOYV8lt7snxMQO/HSbVCFRPMdrhAFMH+vr9giYI=" crossorigin="anonymous"></script>
<script type="module" src="./js/app.js"></script>
<link rel="apple-touch-icon" sizes="180x180" href="./assets/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./assets/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./assets/favicon/favicon-16x16.png">
<link rel="manifest" href="./site.webmanifest">
</head>
<body>
<header style="position:relative;">
<div class="navbar navbar-dark bg-dark shadow-sm">
<div class="container d-flex justify-content-between">
<a href="/" class="navbar-brand d-flex align-items-center">
<strong>🎙️ Fitness Voice</strong>
</a>
</div>
</div>
</header>
<main role="main" class="page-holder bg-cover">
<section class="jumbotron text-center"
style="position: relative; background-color: transparent; padding-bottom: 0px; padding-top: 50px;">
<div class="container">
<h1 id="titleH1" style="color:black;">AI voice-controlled trainer in your browser</h1>
<p class="lead text-muted" style="color:#333333 !important; height: 40px; text-align: left; margin-left: 25%;">
Just say: "Coach, <label id="lblSampleUtterance"></label>
</p>
<p>
<div id="typed-strings" style="display:none;">
<p> I want to train surfing"</p>
<p> change voice to Her"</p>
<p> I want to train gym"</p>
<p> help me"</p>
<p> go home"</p>
<p> change voice to Bill"</p>
<p> show me stats"</p>
<p> change voice to Morgan"</p>
</div>
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<lottie-player id="lottiemic" src="./assets/animations/mic1.json" background="transparent" speed="1"
style="margin-top: -500px; width: 100%; height: 100%;" loop
onclick="showGenericModal('No tap needed :) . Just say Coach, I want to train yoga')"></lottie-player>
</p>
</div>
</section>
<div id="divTraining"
style="position:relative; display: flex; flex-direction: row; height: 600px; margin-top: -80px; margin-bottom: 20px;">
<div id="divCanvasCam" style="display: none; width: 800px; background-color: black; opacity: 0.5;">
<lottie-player id="lottiecameraloading" src="./assets/animations/camera-loading.json" background="transparent" speed="1"
style="width: 100%; height: 100%;" loop></lottie-player>
<canvas id="canvas" height="600" width="800"></canvas>
</div>
<div style="float: right; text-align: center; width: 60%; color: #333333;">
<label id="lblPosture" style="font-size: 80px;"></label><br />
<label id="lblCounter" style="font-size: 200px;"></label>
<img id="imgYoga" src="./assets/images/tree-yoga.jpg" style="height: 78%; display: none;" />
</div>
</div>
<div id="divStats" style="position:relative; height: 500px; margin-top: -80px; margin-bottom: 20px;">
<canvas id="myChart"
style="height: 500px !important; width: 700px !important; margin-left: auto; margin-right: auto;"></canvas>
</div>
<div id="albums" class="album py-5 bg-light"
style="background-color: transparent !important; padding-top: 0px !important;">
<div class="container" style="background-color: transparent;">
<div class="row">
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
<img style="width: 100%;" src="./assets/images/gym.jpg" />
<div class="card-body">
<p class="card-text">Fun gym exercises at home. Gain muscle throughout your body. Reach your next goal!
</p>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<button type="button" class="btn btn-sm btn-outline-secondary"
onclick="showGenericModal('Use your voice to select an exercise :)')">Don't click here</button>
</div>
<small class="text-muted">20 reps</small>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
<img style="width: 100%;" src="./assets/images/surf1.jpg" />
<div class="card-body">
<p class="card-text">Arm exercises for surfers. Improve the strength of your arms and abs. Look at the
results!</p>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<button type="button" class="btn btn-sm btn-outline-secondary"
onclick="showGenericModal('Use your voice to select an exercise :)')">Don't click here</button>
</div>
<small class="text-muted">20 reps</small>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card mb-4 shadow-sm">
<img style="width: 100%;" src="./assets/images/yoga1.jpg" />
<div class="card-body">
<p class="card-text">The main yoga exercises to gain elasticity and feel better. Relax your body and
mind. The tree spirit.</p>
<div class="d-flex justify-content-between align-items-center">
<div class="btn-group">
<button type="button" class="btn btn-sm btn-outline-secondary"
onclick="showGenericModal('Use your voice to select an exercise :)')">Don't click here</button>
</div>
<small class="text-muted">1 figure</small>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="text-muted" style="position: relative;">
<div class="container">
<p class="float-right">
<!-- <a href="#">Back to home</a> -->
</p>
<p>Fitness Voice is a <a href="https://javiercampos.es" target="_blank">Javier Campos</a> project.
Powered by <a href="https://wit.ai" target="_blank">Wit.ai</a>, TensorFlow. Sound effects by <a
href="https://www.zapsplat.com/" target="_blank">zapsplat</a>.</p>
<p></p>
</div>
</footer>
<!-- Modals -->
<div id="genericModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="genericModalTitle"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div id="genericModalTxt" class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-dark" data-dismiss="modal">Lets go!</button>
</div>
</div>
</div>
</div>
<div id="helpModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Welcome to Fitness Voice!</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>🔒 We take privacy very seriously:</p>
<p>🔇 This web is controlled by voice BUT we only process your words online if you have first said the wake
word "coach".</p>
<p>🔮 The wake-word "coach" (hotword) is detected offline thanks to Tensorflow libray.</p>
<p>👯 During exercises, we detect your body posture offline. Webcam images don't go to the Internet.</p>
<p>👩🎤 The coach's voices are not really famous people, they have been created with Artificial Intelligence.
</p>
<p>👋 Hands-free web thanks to <a href="https://wit.ai" target="_blank">wit.ai</a>, <b>you don't need to press
any buttons, just start talking</b>.</p>
</div>
<div class="modal-footer">
<img id="micInHelpModal" src="./assets/images/mic.png" style="height: 20px;" /><i>Say 'Coach, lets go!'</i> <button
type="button" class="btn btn-dark" data-dismiss="modal"> Lets
go!</button>
</div>
</div>
</div>
</div>
</body>
</html>