-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
163 lines (160 loc) · 5.71 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
<!DOCTYPE html>
<html>
<head>
<title>Digit Recognizer using TensorFlow.js Demo</title>
<link href="https://fonts.googleapis.com/css?family=Nunito|Roboto|Poppins" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/app.css">
</head>
<body>
<div class="container">
<div id="mobile-tablet-warning" class="mobile-tablet-warning">
<h3>Oops!</h3>
<p>This demo is highly experimental in mobile and tablet devices. If you are still crazy in trying out this demo, I suggest you to use a laptop or a desktop. Thanks for your understanding! You're cute 😊</p>
<a href="https://www.youtube.com/watch?v=WBi_PZ66z5E&feature=youtu.be" target="_blank">YouTube Video Link</a>
</div>
<div class="emotion-container" id="emotion-container">
<header class="emotion-header">
<h3>Emotion Recognizer</h3>
<p>Made with TensorFlow.js ❤️</p>
</header>
<div class="emotion-wrapper">
<div class="emotion-player emotion-flex">
<div class="emotion-kit">
<div id="emotion-laugh" class="emotion-kit-comps">
<img id="emoticon-laugh" src="assets/images/laugh.gif" />
</div>
<div id="emotion-excited" class="emotion-kit-comps">
<img id="emoticon-excited" src="assets/images/excited.gif" />
</div>
<div id="emotion-sad" class="emotion-kit-comps">
<img id="emoticon-sad" src="assets/images/sad.gif" />
</div>
<div id="emotion-angry" class="emotion-kit-comps">
<img id="emoticon-angry" src="assets/images/angry.gif" />
</div>
<div id="emotion-sleep" class="emotion-kit-comps">
<img id="emoticon-sleep" src="assets/images/sleep.gif" />
</div>
</div>
<div class="emotion-live-cam">
<div>
<video id="main-stream-video" width="200px" height="200px" ></video>
</div>
</div>
</div>
<!--- Controller starts here -->
<div class="emotion-controller emotion-flex" id="emotion-controller">
<!--- Tuner starts here -->
<div class="emotion-tuner" id="emotion-tuner">
<!--- Learning Rate starts here -->
<div class="emotion-dropdown">
<label>Learning Rate</label>
<select id="emotion-learning-rate">
<option>0.00001</option>
<option selected>0.0001</option>
<option>0.001</option>
<option>0.003</option>
</select>
</div>
<!--- Learning Rate ends here -->
<!--- Batch Size starts here -->
<div class="emotion-dropdown">
<label>Batch Size</label>
<select id="emotion-batch-size">
<option>0.05</option>
<option selected>0.4</option>
<option>0.1</option>
<option>1</option>
</select>
</div>
<!--- Batch Size ends here -->
<!--- Epochs starts here -->
<div class="emotion-dropdown">
<label>Epochs</label>
<select id="emotion-epochs">
<option>10</option>
<option selected>20</option>
<option>40</option>
</select>
</div>
<!--- Epochs ends here -->
<!--- Hidden Units starts here -->
<div class="emotion-dropdown">
<label>Hidden Units</label>
<select id="emotion-hidden-units">
<option>10</option>
<option selected>100</option>
<option>200</option>
</select>
</div>
<!--- Hidden Units ends here -->
</div>
<!--- Tuner ends here -->
<!--- Buttons starts here -->
<div class="emotion-buttons">
<button onclick="startWebcam()">Start</button>
<button onclick="train()">Train</button>
<button onclick="predictPlay()">Play</button>
<button onclick="stopWebcam()">Stop</button>
</div>
<!--- Buttons ends here -->
<!--- User acquire starts here -->
<div class="emotion-acquire">
<div class="emotion-acquire-outer">
<div class="emotion-acquire-inner" id="sample-laugh" onclick="captureSample(this.id, 0)">
<div class="emotion-acquire-cam">
<img id="image-laugh" />
</div>
<p>Add 🤣</p>
</div>
<p id="count-laugh">0 samples</p>
</div>
<div class="emotion-acquire-outer">
<div class="emotion-acquire-inner" id="sample-excited" onclick="captureSample(this.id, 1)">
<div class="emotion-acquire-cam">
<img id="image-excited" />
</div>
<p>Add 😲</p>
</div>
<p id="count-excited">0 samples</p>
</div>
<div class="emotion-acquire-outer">
<div class="emotion-acquire-inner" id="sample-sad" onclick="captureSample(this.id, 2)">
<div class="emotion-acquire-cam">
<img id="image-sad" />
</div>
<p>Add 😰</p>
</div>
<p id="count-sad">0 samples</p>
</div>
<div class="emotion-acquire-outer">
<div class="emotion-acquire-inner" id="sample-angry" onclick="captureSample(this.id, 3)">
<div class="emotion-acquire-cam">
<img id="image-angry" />
</div>
<p>Add 😡</p>
</div>
<p id="count-angry">0 samples</p>
</div>
<div class="emotion-acquire-outer">
<div class="emotion-acquire-inner" id="sample-sleep" onclick="captureSample(this.id, 4)">
<div class="emotion-acquire-cam">
<img id="image-sleep" />
</div>
<p>Add 😴</p>
</div>
<p id="count-sleep">0 samples</p>
</div>
</div>
<!--- User acquire ends here -->
</div>
<!--- Controller ends here -->
</div>
</div>
</div>
<script src="https://unpkg.com/@tensorflow/tfjs"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>