-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
73 lines (63 loc) · 2.24 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
<html>
<head>
<meta charset="UTF-8">
<title>TTT</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.0/addons/p5.dom.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/ml5.min.js" type="text/javascript"></script>
<style>
button {
margin: 6px 6px 6px 0;
padding: 4px;
font-size: 16px;
}
video {
width: 400;
height: 400;
}
p {
display: inline;
font-size: 20px;
}
.emoji {
font-size: 24px;
}
</style>
</head>
<body>
<h2>TicTacToe KNN Classification on Webcam Images with mobileNet. Built with p5.js</h2>
<div id="videoContainer"></div>
<p id="status">Loading Model...</p>
<div>
<button id="load">Load Dataset</button><br>
<p>If you load this sample classifer dataset. Try to make X or O gestures to see if the classifier can class them.<br>
<b>PLEASE</b> give a lot of examples so that the machine can be more trained and the results <br>
are near perfect.
If this sample dataset doesn't work well for you, you could train your own classifier,<br>
and use the 'Save Dataset' button below to create your own myKNNDataset.json file,<br>
and replace the myKNNDataset.json in this folder.'
</p>
</div>
<br><p>
<span class="emoji"> O </span><button id="addClassRock">Add an Example to Class O</button>
<button id="resetRock">Reset Class O</button>
<p><span id="exampleRock">0</span> O examples</p>
<p>| Confidence in O is: <span id="confidenceRock">0</span></p>
<br><span class="emoji"> I </span><button id="addClassPaper">Add an Example to Class I</button>
<button id="resetPaper">Reset Class I</button>
<p><span id="examplePaper">0</span> I examples</p>
<p>| Confidence in I is: <span id="confidencePaper">0</span></p>
<br/>
<p>
<button id="buttonPredict">Start predicting!</button><br>
<button id="clearAll">Clear all classes</button><br>
</p>
<p>
KNN Classifier with mobileNet model labeled this
as Class: <span id="result">...</span>
with a confidence of <span id="confidence">...</span>
</p>
<div><button id="save">Save Dataset</button></div>
<script src="sketch.js"></script>
</body>
</html>