-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathrpsls.html
More file actions
executable file
·42 lines (37 loc) · 1.88 KB
/
rpsls.html
File metadata and controls
executable file
·42 lines (37 loc) · 1.88 KB
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
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"></script>
<script src="webcam.js"></script>
<script src="rps-dataset.js"></script>
</head>
<body>
<div>
<div>
<video autoplay playsinline muted id="wc" width="224" height="224"></video>
</div>
</div>
<!-- Buttons for capturing samples for each class -->
<button type="button" id="0" onclick="handleButton(this)">Rock</button>
<button type="button" id="1" onclick="handleButton(this)">Paper</button>
<button type="button" id="2" onclick="handleButton(this)">Scissors</button>
<button type="button" id="3" onclick="handleButton(this)">Spock</button>
<button type="button" id="4" onclick="handleButton(this)">Lizard</button>
<!-- Display sample counts for each class -->
<div id="rocksamples">Rock Samples:</div>
<div id="papersamples">Paper Samples:</div>
<div id="scissorssamples">Scissors Samples:</div>
<div id="spocksamples">Spock Samples:</div>
<div id="lizardsamples">Lizard Samples:</div>
<!-- Buttons to control training and prediction -->
<button type="button" id="train" onclick="doTraining()">Train Network</button>
<div id="dummy">Once training is complete, click 'Start Predicting' to see predictions, and 'Stop Predicting' to end. Once you are happy with your model, click 'Download Model' to save the model to your local disk.</div>
<button type="button" id="startPredicting" onclick="startPredicting()">Start Predicting</button>
<button type="button" id="stopPredicting" onclick="stopPredicting()">Stop Predicting</button>
<button type="button" id="saveModel" onclick="saveModel()">Download Model</button>
<!-- Display prediction results -->
<div id="prediction"></div>
<!-- Include the main JavaScript file -->
<script src="C1_W4_Assignment.js"></script>
</body>
</html>