-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
34 lines (34 loc) · 1.39 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
<html>
<head>
<!-- Load the latest version of TensorFlow.js -->
<script src="https://unpkg.com/@tensorflow/tfjs"></script>
<script src="https://unpkg.com/@tensorflow-models/[email protected]"></script>
<script src="https://unpkg.com/@tensorflow-models/knn-classifier"></script>
<link rel="stylesheet" href="index.css">
</head>
<body>
<video autoplay playsinline muted id="webcam" width="480" height="360"></video><br>
<br>
<button class="button button1" id="class-a">Add A</button>
<button class="button button2"id="class-b">Add B</button>
<button class="button button3"id="class-c">Add C</button><br>
<div id="console"></div>
<!-- Add an image that we will use to test -->
<br>
<input type="file" accept="image/*" onchange="loadFile(event)">
<img id="output" width=227 height=227/>
<script>
var loadFile = function(event) {
var output = document.getElementById('output');
output.src = URL.createObjectURL(event.target.files[0]);
};
</script><br>
<br><button class="button button4"id="btn-predict" onclick="predict()">Predict!</button><br>
<p id="p1"> </p>
<p id="p2"> </p>
<div id="final-prediction"></div>
<!-- <img id="img" crossOrigin src="https://i.imgur.com/JlUvsxa.jpg" width=227 height=227/> -->
<!-- Load index.js after the content of the page -->
<script src="index.js"></script>
</body>
</html>