-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (79 loc) · 3.17 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Teachable Machine</title>
<link rel="shortcut icon" href="teachable-machine.jpg" type="image/x-icon" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="style.css" />
<style>
body {
display: flex;
justify-content: center;
align-items: center;
}
video#webcam {
width: 100%;
height: auto;
}
</style>
</head>
<body>
<div class="container text-center">
<h1>Teachable Machine || Using TensorFlow.JS</h1>
<p id="status">Awaiting For TF.js To Load</p>
<!-- Video Widget -->
<video id="webcam" autoplay></video>
<!-- Buttons -->
<div class="mb-3">
<button id="enableCam" class="btn btn-primary">Enable Webcam</button>
<button class="dataCollector btn btn-primary" data-1hot="0" data-name="Class 1">
Gather Class 1 Data
</button>
<button class="dataCollector btn btn-primary" data-1hot="1" data-name="Class 2">
Gather Class 2 Data
</button>
<button id="train" class="btn btn-primary">Train Your Model</button>
<button id="reset" class="btn btn-danger">Reset</button>
</div>
<ol class="text-start">
<span style="color: #4285f4;">
<li>First Enable Webcam And Allow Access When Asked.</li>
</span>
<span style="color: #ea4335;">
<li>
Now Find An Object, Point The Webcam At It, Click And Hold The
"Gather Class 1 Data" Button To Gather At Least 30 Samples.
</li>
</span>
<span style="color: #fbbc05;">
<li>
Repeat For Class 2 With A Different Object Of Interest. Get A
Similar Number Of Samples.
</li>
</span>
<span style="color: #34a853;">
<li>
Click "Train Your Model" And Wait While The Model Is Trained Live In
Your Browser. No Data Is Sent To The Server.
</li>
</span>
<span style="color: #673ab7;">
<li>
Once Trained, You Will See Live Predictions Appear Above The Video
For What It Thinks It Sees.
</li>
</span>
</ol>
<footer class="text-center" style="padding: 10px; background-color: bisque">
Copyright © 2023 By ::
<a href="https://pabitrabanerjee.newsgoogle.org" style="text-decoration: none"><span
style="color: crimson; font-family: cursive">Pabitra Banerjee</span></a>
</footer>
</div>
<!-- JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js" type="text/javascript"></script>
<script type="module" src="script.js"></script>
</body>
</html>